Genetic Algorithms: When Drift Overcomes Selection

I often encounter posters here at TSZ who claim that Genetic Algorithms (GAs) either model or simulate evolution. They are never quite clear which it is, nor do they say what it means to model or simulate evolution (what would be required) and how GAs qualify as either one or the other. My position is that GAs neither model nor simulate evolution. In addition to other reasons I’ve given in the past I’d like to present the following argument.

GAs are often used to demonstrate “the power of cumulative selection.” Given small population sizes drift ought to dominate yet in GAs drift does not dominate. Why not?

Three questions:

  1. How do we determine the effective population size for a GA?
  2. How do we calculate the value of the selection coefficient?
  3. How do we determine when genetic drift will overcome the effects of selection?

In a GA written by keiths (a version of the WEASEL program) the default population size is 200.

#define POPULATION_SIZE 200 // total population size

Effective population size is the number of individuals in a population who contribute offspring to the next generation.

Even though the population size is 200, only one is selected to contribute offspring to the next generation.

#define NUM_SURVIVORS 1 // number of survivors per generation (must be less than POP_SIZE)

Given an effective population size of one, drift ought to dominate, but it doesn’t.

Given an effective population size of one, what must the selection coefficient be for drift to not dominate selection?

I’d truly appreciate any assistance with the concepts or the math.

In any event, there is no way that this GA (the keiths WEASEL program) either models or simulates evolution.

Reference:

Neutral Theory: The Null Hypothesis of Molecular Evolution

535 thoughts on “Genetic Algorithms: When Drift Overcomes Selection

  1. keiths,

    Are you saying that sequential space does not create any challenge for trying to find an evolutionary mechanism? I understand the tactic of trying to make an argument generic so you can dismiss it. Cubist is using the same tactic. If you are trying to do this it is because it is a difficult one to deal with. You should know because sequential space is what makes weasel require a target. BTW I am halfway through the book you recommended and think it is great 🙂 Looking forward to discussing it.

  2. petrushka: If you would like to not appear ignorant, get the book and learn something.

    Do let us know once you’ve obtained and read Denton’s latest.

  3. Allan Miller: When someone trots out something looking very similar to Hoyle’s argument, I have a knee-jerk reaction to it.

    But it’s not a “real tornado.”

  4. colewd:
    cubist,

    The truth is we scan over everyone’s arguments.I think if look at the detail of what I am saying it is not Hoyle’s argument.

    You’re not using exactly the same words Hoyle used, no. But your argument differs from Hoyle’s tornado-in-a-junkyard argument only in the words you used; you’ve essentially filed the serial numbers off of Hoyle’s argument and given it a fresh coat of paint. But those cosmetic alterations do nothing to change the underlying substance of the argument, and the substance of your argument is, indeed, the same as the substance of Hoyle’s tornado-in-a-junkyard argument.

  5. JoeCoder: I can tell that some of the commenters here are very intelligent. Maybe if there were better moderation I’d spend more time here.

    There’s nothing wrong with the moderation here and this site is just what Lizzie had in mind. And this is the wrong place to raise moderation issues. Did you not read the site rules?

  6. petrushka: Deism is compatible with evolution. Do we have any deistic IDists around?

    I don’t think Denton is a deist but his book could be considered as belonging to the genre of deist ID.

  7. Mung: As long as you don’t question this forum. For that you get your threads censored.

    Open, honest, frank, direct, except when it isn’t. A new motto for TSZ.

    So dishonest. There is a place specifically for moderation issues. What there isn’t is a tolerance for creationists looking to create a false equivalence with UD by thread spamming.

  8. colewd: BTW I am halfway through the book you recommended and think it is great. Looking forward to discussing it.

    petrushka is also a big fan. Please do start an OP on it. I’ll join in, as long as people are willing to accept that I actually read science books. It is a science book, isn’t it? It’s even about biology, right?

  9. colewd:
    keiths,

    Are you saying that sequential space does not create any challenge for trying to find an evolutionary mechanism?

    Why should “sequential space… create any challenge for trying to find an evolutionary mechanism”? I strongly suspect that whatever answer you come up with, if any, said answer will incorporate the (perhaps implicit) presumption that biologically-interesting sequences are, in fact, evenly distributed throughout the entirety of sequence space. I would suggest you ponder the consequences if that presumption is actually not true.

  10. Richardthughes: What there isn’t is a tolerance for creationists looking to create a false equivalence with UD by thread spamming.

    Well, since you’re obviously not talking about me, I don’t much care.

  11. I’m sure you got tired of pointing out how Wagner contradicts even the regulars here (forget about ID advocates) and have long since given up arguing with them about it.

    Must be lonely, caught in the middle like that.

  12. Mung:
    I’m sure you got tired of pointing out how Wagner contradicts even the regulars here (forget about ID advocates) and have long since given up arguing with them about it.
    Must be lonely, caught in the middle like that.

    An the truth can be munged one little deviation at a time, until it no longer has any resemblance to fact. I recommend reading the wagner thread.

  13. Mung,

    But it’s not a “real tornado.”

    Er … no, it isn’t. That was probably cleverer in your head.

  14. Mung,

    I’m sure you got tired of pointing out how Wagner contradicts even the regulars here

    I can’t even begin to tire of something I’ve never actually noticed.

  15. Allan Miller:
    Mung,
    I can’t even begin to tire of something I’ve never actually noticed.

    I suppose a word lawyer can equivocate until Wagner appears to contradict someone’s position, but I don’t recall any instances. I know that I was not aware of his thesis until his book came out. Since then I find it is mainstream.

  16. cubist,

    The argument is set up mathematically differently the Hoyle because I do not assume a single target of success. The way I have set the argument up has been used as a platform of debate. The rareness of protein folds that function is well acknowledge in the book Keith’s recommended to me.
    .http://aghunt.wordpress.com/

  17. Mung:
    …given the staggering odds, selection is not enough…

    – Andreas Wagner

    So you finally learned about drift and won’t be making stupid questions about GAs and natural selection or ignorant claims about “darwinism” now?

    Way to go Mungy, way to go!

  18. I set aside two other science books I was reading to finally read this one. I hope you’re satisfied.

    That Darwin never explained the arrival of the fittest seems to be a gaping problem with the theory.

  19. This is DRIFTING WEASEL

    You can modify the S_COEFFICIENT of the fittest form.

    I put a hefty one at S_COEFFICIENT at 1.1 and you can see the effect of having a little drift it converges in about 5000 generations versus 400 without drift.

    Since there are only 25 individuals in the population, an S Coefficient of 1.1 means 2.1 (1+S) individuals are guaranteed in the population of 25, but since 2.1 is not a whole number, every 1 out of 10 generations I add 3 individuals of that form to the population to get an average 2.1fittest individuals per generation over many generations.

    As you increase the S_COEFFICIENT to around 12 or higher, one starts to get convergence rapidly as the drift component is lessened as the strength of selection is increased.

    You can also increase the mutation rate per individual.

    http://creationevolutionuniversity.com/forum/viewtopic.php?f=4&t=129&p=648#p648

    When I used weak selection of 0.01 and 4 mutations per individual, even after a million generations there was no convergence.

  20. When I increase the population size to 2500 at S=0.10, the problem of gambler’s ruin appears and there is no convergence even after a 100,000 generations, in fact evolution looked like it was stuck in a random walk!

    Even though in one sense selection is more effective in large populations provided the concentration of individuals with the favourable trait is a good fraction of the population, if the population size is increased but there is only one individual with the trait for starters, then the odds become worse that the trait will fix. Exactly as I predicted 9 years ago here:

    Gambler’s ruin is Darwin’s ruin

    Should that surprise anyone? Does any one believe a trait a new trait is going to fix in the human population (7 Billion people) by natural selection in the life of the solar system?

  21. Mung,

    That Darwin never explained the arrival of the fittest seems to be a gaping problem with the theory.

    If we had made no progress since 1859, mebbe.

  22. stcordova,

    Even though in one sense selection is more effective in large populations provided the concentration of individuals with the favourable trait is a good fraction of the population, if the population size is increased but there is only one individual with the trait for starters, then the odds become worse that the trait will fix. Exactly as I predicted 9 years ago here:

    There is not just one mutation in a typical population. And see Kimura’s work on the probability of fixation of single-copy mutants.

    Population geneticists. What the heck do they know?

    Should that surprise anyone? Does any one believe a trait a new trait is going to fix in the human population (7 Billion people) by natural selection in the life of the solar system?

    What relevance does that have to prior evolution? Do all populations consist of either 7 billion plus members or two?

  23. There is not just one mutation in a typical population. And see Kimura’s work on the probability of fixation of single-copy mutants.

    Population geneticists. What the heck do they know?

    Hehehe, I did as you suggested and put in mutiple mutations, and it went into random walk mode, you can see it real time if you run it. Here were the parameters:

    ]#define ITERATION_LIMIT (1000*1000)
    #define NUMBER_KIDS 2500
    #define S_COEFFICIENT 1.10
    #define NUMBER_MUTATIONS_PER_INDIVIDUAL 25

    In fact now that I think about it, I think I could add one more refinement to the program to improve the drifting model.

  24. stcordova,

    #define NUMBER_MUTATIONS_PER_INDIVIDUAL 25

    No, I mean there is more than one mutation in the population at any one time. The probability that one mutation will be lost is not the probability that all mutations will be lost. Nor is it additive.

  25. You will find that drift and/or mutation can nullify selection under certain (but not all) conditions. Therefore what?

  26. Sal said:

    In fact now that I think about it, I think I could add one more refinement to the program to improve the drifting model.

    Bwahaha! I added the refinement so that it is a tad more biologically realistic, and voila, it doesn’t converge unless one sets the S Coefficient to some high value like 2.1. Bwahaha! Otherwise randomness reigns, exactly as I predicted. Bwahaha!

    http://creationevolutionuniversity.com/forum/viewtopic.php?f=4&t=130#p649

    This will converge:

    #define ITERATION_LIMIT (1000*1000)
    #define NUMBER_KIDS 25
    #define S_COEFFICIENT 2.1
    #define NUMBER_MUTATIONS_PER_INDIVIDUAL 1

    This won’t:

    #define ITERATION_LIMIT (1000*1000)
    #define NUMBER_KIDS 25
    #define S_COEFFICIENT 1.10
    #define NUMBER_MUTATIONS_PER_INDIVIDUAL 1

  27. DRIFTING WEASEL V2
    http://creationevolutionuniversity.com/forum/viewtopic.php?f=4&t=130#p649

    Has some nice features to illustrate population genetic concepts.

    1. As the strength of selection is increased (the S_COEFFICIENT), the more quickly the population converges on the fittest form and the target.

    2. If the strength of selection is too weak, the population never converges on the target except by random walk.

    3. Gambler’s ruin is modelled — that is if the population size is large and only one favorable trait appears in a generation, it is usually wiped out.

    4. High mutation rates induce genetic erosion.

    Refinements could be added, but it shows a lot of the basics. Bwahaha!

    Happy Kimura Day!

  28. stcordova,

    Do you realize you’re working with a model that has a very unrealistic one-way fitness function with a single peak? In that scenario of course you’re going to have a massive bias for selection.

    If you then tune the params to work as an almost purely random search, of course it’s going to perform a lot like a random search. Did you really need to code it to figure that out?

  29. Also some of the pros correct me if I’m wrong, but even if there are 2500 mutants, if only one is selected for, then the effective population is 1, so decreasing the selection coefficient can’t be overcome by increasing the number of mutants if the effective population remains 1

  30. Do you realize you’re working with a model that has a very unrealistic one-way fitness function with a single peak? In that scenario of course you’re going to have a massive bias for selection.

    If you then tune the params to work as an almost purely random search, of course it’s going to perform a lot like a random search. Did you really need to code it to figure that out?

    I needed the code to do some internet theatre. 🙂

    I was trying to and drive home the point I was right about the fact mutation and drift hinders the Darwin/Dawkins/Dennett (DDD) vision of how evolution works.

    Hey, I at least try to model selection strength with s_coefficients. What GA has been presented on TSZ has such a user friendly user specified s_coefficient model?

    An s_coefficient of 0.1 has a 0.1 (10% advantage) in terms of number of offspring compared to the rest of the field. An s_coefficient of 2.1 has a 210% advantage in terms of number of offspring. Now implementing this in such a simple program simplifies a few things, but it gets the basic point across that the influence of drift increases as the strength of selection weakens (s_coefficient).

    Now isn’t that a wonderful educational tool to teach population genetics just by tweaking Dawkins WEASEL to have a bit of drift in it?

  31. stcordova: Hey, I at least try to model selection strength with s_coefficients. What GA has been presented on TSZ has such a user friendly user specified s_coefficient model?

    I dunno. Maybe Joe F’s

  32. stcordova,

    Gambler’s ruin is modelled — that is if the population size is large and only one favorable trait appears in a generation, it is usually wiped out.

    Mutation rate and population size are related. Bwaha. You can’t increase the population size and keep the overall population’s per-generation mutation incidence the same. Bwaha.

  33. , if only one is selected for

    That was the unrefined model here, DRIFTING WEASEL V1 where only 1 survivor remained. It didn’t guarantee however that the fittest was the sole survivor because it partially models drift (where even the fittest can die):

    http://creationevolutionuniversity.com/forum/viewtopic.php?f=4&t=129&p=646#p648

    V1 converged more frequently on the solution as long as the population size was small, but when population size was increased, the problem of gambler’s ruin emerged, and the model went into a random walk.

  34. stcordova,

    I was trying to and drive home the point I was right about the fact mutation and drift hinders the Darwin/Dawkins/Dennett (DDD) vision of how evolution works.

    A view no-one, including the named individuals, actually holds.

  35. stcordova,

    Don’t get me wrong, I applaud the effort. Actually I have downloaded the code and will be playing with it in a while.

    stcordova: I was trying to and drive home the point I was right about the fact mutation and drift hinders the Darwin/Dawkins/Dennett (DDD) vision of how evolution works.

    Well, you initially seemed to be out to prove that drift would nullify selection with a sufficiently increased population, but for all I know you’ve failed to demonstrate that. That would actually be contrary to known population genetics.

    Drift doesn’t hinder evolution, it’s part of it. Don’t you think you should stop pretending that’s the end of “darwinism” or evolution?

  36. Mutation rate and population size are related. Bwaha. You can’t increase the population size and keep the overall population’s per-generation mutation incidence the same. Bwaha.

    Yes, I know where you are headed, in neutral model mutation rate equals fixation rate, and in a positive selection model, fixation rate of beneficials is higher than mutation rate of beneficials.

    But ruin will happen if the proportion of bad is sufficiently larger than the good.

  37. Don’t get me wrong, I applaud the effort. Actually I have downloaded the code and will be playing with it in a while.

    Thanks. Anyone here who can program can write their own evolutionary model that models selection + drift. I gave my own simplistic model, but it isn’t the final word, it is just an educational tool.

    Anyone with a better tool to illustrate selection + drift, I’d be glad to use it to teach.

  38. stcordova: But ruin will happen if the proportion of bad is sufficiently larger than the good.

    No doubt you have figured out how to model the reason it doesn’t happen in living populations, in the absence of environmental change or increased competition or predation.

  39. stcordova: Bwahaha!I added the refinement so that it is a tad more biologically realistic, and voila, it doesn’t converge unless one sets the S Coefficient to some high value like 2.1.Bwahaha!Otherwise randomness reigns, exactly as I predicted.Bwahaha!

    http://creationevolutionuniversity.com/forum/viewtopic.php?f=4&t=130#p649

    This will converge:

    This won’t:

    Neither will converge because the code at that link doesn’t run. After compiling with gcc on OS X, here’s what the output looks like:

    kid 0=S%D2NB/V@’3DSF%9!OAE)51>&5GF
    kid 1=,Q ?7IZ?/Z9(/L:J0O&MZ?3′82U(*,:EUPE&M9&E.6C,:”0
    kid 3=4U9*N.IAO@H:7LCP&:VL!M#<.1DO kid 4=7JX3LB5'PAMZ5%*4VT/I>5F#6&;     kid 5=G(HI6? XZ,(MO'@3ISE3.!5F+L=
    kid 6=03Q(59E*ZAU.B+GQ2IY)547#HZG     kid 7=!S0>>,;0).(4 15>8:OHPVXR4.P8     kid 8=@M/U/'ALG;AT&(*2?2Q,0VS(FP6S     kid 9=00M<'%F(+*ZOZ0?6*+DIIQ,S?.O
    kid 10==47!1.F*HC’T?VX’O%2Q2*!9PQ7+
    kid 11==R9JET8.6L1T’5,VMDV-SYV3J#”?
    kid 12=*:V1249A.EB=(TJQ2RMZ1&RLD->:
    kid 13=.U&RV”M6%(5#;<X ,-199E PIY:     kid 14=X!R&GTNRCG>BF#L):H5;(S*Y C<#     kid 15=FT;:7XD=Q.0?BZHSB*5?74Q*3QJ
    kid 16=:P),IP2SKO?!+<&=6H(4*G+6%YSK kid 17=4L&HC0+JJ,-BGV&-5&"DU,#SBD+H kid 18=6&;*+2:5!:Y(9X@XR,N/!;'.L'IU kid 19=T;K8T'88JH36L#S?B2%!WBW-E'*     kid 20=&==SO'+OP"PDCM)'TA3/@F@/Z9;P     kid 21=X(#:78C:N9M0G1HT=XZ?S:**QR!4     kid 22=+0&14P519EZRMWXVQG;?V"3.6SW)     kid 23=0+NDPMK?0.O%-&RF”8G@’:)8)’
    kid 24=HW,H”#5HGJ:E”33GB3%7JAB@?J7D
    Abort trap: 6? XZ,(MO’@3ISE3.$!5F+L=

    And that’s before I’ve even bothered to figure out what you’re actually modeling, if anything.

    ETA: My apologies for the formatting — evidently LaTeX mode took over.

  40. Neither will converge because the code at that link doesn’t run. After compiling with gcc on OS X, here’s what the output looks like:

    I provided the compiler I ran it on, you can run it there:

    http://www.tutorialspoint.com/compile_c_online.php

    My output:

    …..
    kid 13==(‘;.>E?Q=TO@14RC8> 7-UY#ROO
    kid 14=E4″,=)GOK63BS1:8BR4+0V/G,-F0
    kid 15=>NS&Z53J-%@J!U)>= RL4Q %"                                                                                                                     kid 16=-O252;(*E'CYRP& :T"4"@U&;F;1                                                                                                                     kid 17=JD7W8J2J.>YSFAUA; AYTG6Z,1&K                                                                                                                     kid 18= E!K.9KF,"9:A720"-QA1;?/(U28                                                                                                                     kid 19=/<)0&.8KO' VE:@!QT''NHC%RN7V/,O7,N!G3&A,.HZZ-1
    kid 21=4″LC)H*PQ”C1!S=T3JG8:#> 3PL6
    kid 22=T”H-=T1.#+()N9+JW(&JP>)W&-0                                                                                                                     kid 23=V"FS7%-TYB+&M3/EQ:8QG?@<&MM0&!6W5FA+)Z%P>E5
    fittest=METHINKS IT IS LIKE A WEASEL
    integer = 2 fractional=0.100000 out_of=9
    hit target in 54214 generations

    It converged if you used the right hardware and software.

  41. No doubt you have figured out how to model the reason it doesn’t happen in living populations, in the absence of environmental change or increased competition or predation.

    What do you mean, I was being generous. Look at this:

    http://www.cnn.com/2016/02/13/world/penguins-die-giant-iceberg-irpt/

    I guess Natrual selection and increased competition didn’t help those poor penguins.

    As far as increased predation, how about the Whale populations on the planet. Doesn’t look like their absolute fitness is increasing with all the humans hunting them down.

    Don’t you see, a black swan or a miracle made the diversity of complex life on Earth, not predation or increased competition or reduction of resources in the struggle for existence.

  42. Allan Miller: If we had made no progress since 1859, mebbe.

    Yes, just a few years ago Andreas Wagner and his group uncovered the secret ingredients. They are non-Darwinian.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.