# 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. Mung:Hilarious. Next time read the OP.

I don’t think anyone is deliberately being obtuse here, and everyone is addressing what they think you mean.

2. Mung: This is false.

It might be false, but it’s a fair statement based on what you have written, according to the most reasonable interpretation.

When nobody but you understands what you mean, consider it possible that you have not expressed what you meant in terms others understand. Whole threads are filled with people mis-guessing the intent of your words.

3. stcordova: The accuracy of WEASEL to model biological evolution would be greatly improved if selection of advantageous traits were not deterministic (as in always picking the best).

But the keiths WEASEL has drift! 199 members out of every 200 in each generation drift to extinction. Then that one survivor leaves exactly 199 offspring. It’s downright miraculous. It’s like Noah’s ark over and over again.

4. Mung: This is false.

I base it on things you have said, including thr OP. Perhaps it would be more accurate to say you haven’t convinced anyone that you understand GAs.

5. petrushka: WEASEL doesn’t have a population.

After you read the OP, why wasn’t this the first thing out of your mouth?

Are you calling keiths a liar?

6. stcordova: Any way, Mung was curious what happens when drift is admitted into the model. Short answer: WEASEL explodes — kaboom!

Actually that wasn’t the point of the OP, lol. But thanks for reading it and commenting.

7. I haven’t looked at keiths version of WEASEL, but in general, if only one individual reproduces, it isn’t called a population.

Out of many possible wheels spinning in biological evolution, WEASEL only models cumulative selection.

Variations on Dawkins’ algorithm might add features. I’ve done a version that has no target and drifts.

If you follow Dawkins’ algorithm, selection is based on the number of characters that match the target. It makes no difference which characters. One generation might have three matches, and a subsequent generation might have four matches, none of them the same characters.

This could be called drift. It certainly isn’t latching, but isn’t a realistic model of drift in biology.

8. petrushka: I don’t exactly follow how you can derive anything from a program that is designed to behave in ways that have nothing to do with biology.

Now you know what I think about the WEASEL program. So why do you keep insisting that if only I knew how it really worked I might change my mind?

Why are none of the fans of GA’s here and their importance to biology not getting together and writing a GA step-by-step where everyone can see and ask questions? Show us how it’s done.

9. dazz: Keiths, can’t seem to find your weasel algo. Care to repost please?

Why? You’ve already declared it’s not a GA.

10. Mung: At least you admit to quote-mining.

Quoting your entire comment and providing a link isn’t quote mining, no matter how badly it reflects on you.

11. keiths: So what Mung regarded as “pedantry” on my part is actually an important distinction.

Whatever. You changed your code and now we find out about it. Sue me for not knowing about it.

12. Patrick: Quoting your entire comment and providing a link isn’t quote mining, no matter how badly it reflects on you.

You took the quote out of context. You quote-mined.

You provided a link. So what. Next time I quote an evolutionist I’ll be sure to mention the book it came from as if that will protect me from charges of quote-mining.

13. DNA_Jock: Given this observed adaptation, what is the probably that a trial and error mechanism could have caused {it or something equivalent to it}?

How did you determine it was an adaptation?

14. Mung,

Did you even read the OP?

Yes, and my comment is correct:

Mung seems to have realized that the selection coefficient matters, as the Nature article stresses. He wrote:

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

Yet he went ahead and made his categorical statements despite having no inkling of the actual value of the selection coefficient.

Typical Mung sloppiness.

Here’s a hint, Mung: a mathematical product such as Ne * s depends on the value of all its factors, not just one.

15. Mung: You took the quote out of context. You quote-mined.

Only if the quote misrepresented your intent. Did it?

If the context is considered to be comprised of every post you have made, it would be essentially Impossible NOT to quote anyone out of context.

You provided a link. So what. Next time I quote an evolutionist I’ll be sure to mention the book it came from as if that will protect me from charges of quote-mining.

That’s probably a step in the right direction. A link directly to the point in the book it came from would be easier to follow. It’s not all that uncommon for footnotes to reference materials that fail to support the footnoted claim, or even contradict it. Creationists, for whatever reason, seem to be overrepresented among those who do this.

16. Flint: Only if the quote misrepresented your intent. Did it?

Would I be calling it a quote-mine if I didn’t think he was quote-mining?

17. Mung,

I clearly and unambiguously mentioned the selection coefficient in the OP in the context of the question of population size and drift and provided a link to the paper. I was obviously aware of it’s relevance. For keiths to claim what he did is just keiths being himself. It needed to be called out.

Dude, you’re losing it.

Here’s what I wrote:

Mung seems to have realized that the selection coefficient matters, as the Nature article stresses. He wrote:

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

Yet he went ahead and made his categorical statements despite having no inkling of the actual value of the selection coefficient.

Typical Mung sloppiness.

My comment is correct.

18. keiths: Here’s a hint, Mung: a mathematical product such as Ne * s depends on the value of all its factors, not just one.

Who thought otherwise?

Ne * s – let’s break it down for you.

Given an effective population size of one [there’s the ‘Ne’], what must the selection coefficient [there’s the ‘s’] be for drift to not dominate selection [see how I wasn’t appealing to just population size]?

Here’s the three questions again, because keiths wants to make them go away:

Three questions:

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

Note all the elements. Note that I actually used the same wording as that in the paper itself which keiths thinks I didn’t bother to read.

In other words, in small populations, the stochastic effects of random genetic drift overcome the effects of selection.

Joe F got it. keiths can get it too.

19. Mung: Now you know what I think about the WEASEL program. So why do you keep insisting that if only I knew how it really worked I might change my mind?
Why are none of the fans of GA’s here and their importance to biology not getting together and writing a GA step-by-step where everyone can see and ask questions? Show us how it’s done.

Change your mind from what? The only thing I’m sure of is you don’t like mainstream biology. Nor GAs. But I have no idea why. What you write is a disorganized mess.

20. keiths:

Here’s a hint, Mung: a mathematical product such as Ne * s depends on the value of all its factors, not just one.

Mung:

Who thought otherwise?

You did:

Given small population sizes drift ought to dominate yet in GAs drift does not dominate.

And:

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

It’s just another failure, Mung. Why are you so riled up about it?

21. Mung: In other words, in small populations, the stochastic effects of random genetic drift overcome the effects of selection.

Joe F got it. keiths can get it too.

I don’t get it. When you use the word “overcome”, do you mean that drift has a larger influence over future population allele mix than selection? Or does this mean that drift somehow negates selection?

I understood Joe F. as saying that drift is always present, and selection may have either a greater or a lesser influence than drift over future populations, depending.

22. keiths:
keiths:

Mung:

You did:

And:

It’s just another failure, Mung.Why are you so riled up about it?

I don’t understand your objection here. You seem to be saying that if one effect “dominates” another, than the lesser effect is being ignored. But one effect cannot dominate another if the other isn’t there at all.

23. petrushka: Change your mind from what? The only thing I’m sure of is you don’t like mainstream biology. Nor GAs. But I have no idea why. What you write is a disorganized mess.

I don’t dislike mainstream biology. I probably read more biology than you do [1].

I don’t dislike GA’s

So much for what you are sure of petrushka. But that also helps explain why you don’t know why I don’t like them.

[1] Assuming I’m allowed to include such things as biochemistry and history and philosophy of biology, etc..

24. Mung:

keiths: Turn off selection and the program won’t converge on the target.

LoL. So?

You left out a sentence:

The answer, of course, is that we’re seeing the power of cumulative selection. Turn off selection and the program won’t converge on the target. [Emphasis added]

What were you saying about quotemining?

ETA: And by the way, that was an answer to your question:

Are we really seeing “the power of cumulative selection” or are we seeing “the power of cumulative random sampling”?

Suck it up, Mung. Weasel demonstrates the power of cumulative selection.

25. Flint: But one effect cannot dominate another if the other isn’t there at all.

What’s your point? Drift is always present, even if selection is present. Even if there’s no selection you still have drift.

I’m assuming that in a GA selection is present, else what’s the point of the GA, especially if the purpose of the GA is to “demonstrate the power of cumulative selection”?

26. Mung: I don’t dislike mainstream biology. I probably read more biology than you do [1].

I don’t dislike GA’s

So much for what you are sure of petrushka. But that also helps explain why you don’t know why I don’t like them.

[1] Assuming I’m allowed to include such things as biochemistry and history and philosophy of biology, etc..

He is sure of these things because you have made it abundantly clear to anyone reading your posts. In this very post you say “I don’t dislike” GAs, and in the next sentence “I don’t like them.” After some careful parsing, I can read the “I don’t like them” as being a consequence of a restatement of a misreading. This is muddled writing.

Face it, you come across here as an opponent of evolutionary theory. Since GAs (the good ones) are actual examples of the workings of that theory, one would conclude that you don’t like (or agree with) what these programs illustrate.
And since evolution lies at the very heart of mainstream biology, it’s not consistent to dispute evolutionary theory and still “like” mainstream biology, which rests on that theory.

27. I assume you don’t like mainstream biology because you show contempt for mainstream biology. You show little about yourself other than hatred and contempt for science.

If i am wrong, I have a lot of company. I can only judge by wwhat you write here and at UD.

28. Mung: What’s your point? Drift is always present, even if selection is present. Even if there’s no selection you still have drift.

I’m assuming that in a GA selection is present, else what’s the point of the GA, especially if the purpose of the GA is to “demonstrate the power of cumulative selection”?

I was asking keiths what he meant, since your terminology included both population size and selection coefficient. And your term “dominate” implied this.

29. You got spanked keiths. Admit it and grow from it.

You’d have everyone believe that Joe F answered a question I never asked.

And yes, people were claiming that GA’s model evolution. And dazz claimed your program wasn’t a GA. And petrushka now agrees with dazz because [he says] your program doesn’t even have a population.

Amazing how your program all of a sudden grew some new features.

30. I guess I’m just an idiot to think not liking something is disliking it.

There’s more than a little muddled writing on this subject.

Drift, for example, should be confined to meaning a change in allele frequency in a population. It shouldn’t be used in a population of one replicator. Even if i have done it. It’s muddled writing.

31. Mung:
You got spanked keiths. Admit it and grow from it.

You’d have everyone believe that Joe F answered a question I never asked.

And yes, people were claiming that GA’s model evolution. And dazz claimed your program wasn’t a GA. And petrushka now agrees with dazz because [he says] your program doesn’t even have a population.

Amazing how your program all of a sudden grew some new features.

One thing that has come out of all this discussion is that there exist a great many programs written to illustrate one aspect or another of the evolutionary process and the factors that influence it. And it has been pointed out that the entire process is far too complex for any program to faithfully model every possible factor. All these programs are simplifications.

So how simple does an example need to be, to be “not a GA”? What is the minimal set of essential factors that must be included? Does having an explicit target disqualify a program? Or a population of one? Or the omission of drift?

Or should we rather be asking if a program usefully clarifies and illustrates some aspect of the overall process, with the understanding that yes, there are other aspects not being examined?

32. keiths:

That’s because in the newer version, neutral mutations in the survivor will automatically become fixed unless the survivor is displaced by one of its offspring. In the older version, neutral mutations can only become fixed by “piggybacking” on an offspring that is about to displace the survivor. (All of the above assuming that NUM_SURVIVORS is set to 1.)

So what Mung regarded as “pedantry” on my part is actually an important distinction.

Mung:

Whatever. You changed your code and now we find out about it. Sue me for not knowing about it.

No, your comment came first. I made the code changes as a first step toward demonstrating your error to you, since I figured you’d be unable to understand, much less successfully modify, my code.

33. petrushka: I assume you don’t like mainstream biology because you show contempt for mainstream biology. You show little about yourself other than hatred and contempt for science.

LoL. I am currently actively reading four science books, three of which are directly related to biology:

If i am wrong, I have a lot of company. I can only judge by wwhat you write here and at UD.

If you’re wrong it’s because you don’t abide by Lizzie’s wishes for the site. You see what you want to see. You should read what I write and ignore the trolls. You might try less snark and more dialog as well.

Or maybe you’re comfortable with things just as they are and just as you see them.

“I beseech you, in the bowels of Christ, think it possible that you may be mistaken.”

34. Mung: LoL. I am currently actively reading four science books, three of which are directly related to biology:

Yet that contempt DOES come through, book reading notwithstanding. As far as I can tell, everyone on the pro-science side at TSZ regards you as being a member of the anti-science side. If everyone is wrong but you, there might be something about your writing that is confusing people.

If you’re wrong it’s because you don’t abide by Lizzie’s wishes for the site. You see what you want to see. You should read what I write and ignore the trolls. You might try less snark and more dialog as well.

I point out that everyone else sees this same thing. Why do you suppose that is?

35. Flint:

I was asking keiths what he meant, since your terminology included both population size and selection coefficient. And your term “dominate” implied this.

Mung’s statements are incorrect because they don’t take the selection coefficient into account:

Given small population sizes drift ought to dominate yet in GAs drift does not dominate.

And:

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

Knowledge of the effective population size isn’t enough.

36. keiths:
Flint:

Mung’s statements are incorrect because they don’t take the selection coefficient into account:

And:

Knowledge of the effective population size isn’t enough.

Yes, I know. But what is he saying that drift should dominate, if not selection? And how can selection dominate drift if selection is not being considered? He asks directly, what must the selection coefficient be, such that drift STILL does not dominate in a population of one?

I read mung’s statements as follows:

Given small population sizes drift ought to dominate (over selection) yet in GAs drift does not dominate (selection).

And:

Given an effective population size of one, drift ought to dominate (selection), but it doesn’t (dominate selection, implying an infinite selection coefficient).

37. Mung,

You’d have everyone believe that Joe F answered a question I never asked.

Good grief, Mung. I quoted you asking the question:

Mung seems to have realized that the selection coefficient matters, as the Nature article stresses. He wrote:

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

Then I proceeded to explain your error:

Yet he went ahead and made his categorical statements despite having no inkling of the actual value of the selection coefficient.

Typical Mung sloppiness.

Knowing the value of Ne alone is insufficient to determine the value of Ne * s. It doesn’t get much simpler than that, Mung.

38. keiths:
Knowing the value of Ne alone is insufficient to determine the value of Ne * s.It doesn’t get much simpler than that, Mung.

But, unless I’m really misreading, if the value of Ne * s is known, and the value of Ne is known, then the value of s can be calculated. So if Ne is 1 and Ne * s is >1, then s must be >1. What am I missing?

39. Flint:

But what is he saying that drift should dominate, if not selection?

He is saying (incorrectly) that drift should dominate selection.

And how can selection dominate drift if selection is not being considered?

He is considering selection. He just gets it wrong.

He asks directly, what must the selection coefficient be, such that drift STILL does not dominate in a population of one?

Yes. But instead of waiting for an answer, he makes the following two incorrect assertions despite having no inkling of the value of the selection coefficient:

Given small population sizes drift ought to dominate yet in GAs drift does not dominate.

And:

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

You need to know both Ne and s before you can decide whether drift “ought” to dominate.

As I said:

Knowing the value of Ne alone is insufficient to determine the value of Ne * s. It doesn’t get much simpler than that, Mung.

40. Flint: So if Ne is 1 and Ne * s is >1, then s must be >1. What am I missing?

Nothing. As I mentioned (way back in this thread) in the Weasel, if when one has the favorable mutant, it always ends up replacing the parent, then in effect . Which is fine.

41. Flint:

But, unless I’m really misreading, if the value of Ne * s is known, and the value of Ne is known, then the value of s can be calculated. So if Ne is 1 and Ne * s is >1, then s must be >1. What am I missing?

Mung didn’t know the value of Ne * s.

42. keiths:
Flint:

Mung didn’t know the value of Ne * s.

Uh, OK. I thought the outcome of the program WAS Ne * s. You have a population of 1, you retain any beneficial mutation for the next round, s is infinite. You retain beneficial mutations more often than not, s > 1.

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