NATURAL SELECTION
and Genetic Drift
Explanation
This program simulates evolution within a stable population of uniform size. Within this population,
genetic variation occurs in the form of two alleles, A (dominant) and a (recessive). Thus, there are three genotypes:
        AA   Homozygous dominant         Aa   Heterozygous (with dominant phenotype)         aa   Homozygous recessive
The frequency of allele A is called p, and the frequency of allele a is called q.

In each generation, the program randomly picks gametes (eggs and sperm) from two random parents to determine the genotype of the next offspring.
The probability of that offspring surviving to reproductive age and successfully reproducing is called its fitness, a number from 0.0 to 1.0, inclusive.
The program then picks offspring again and again, in the same way, until enough are chosen to keep the population at a constant population size.
The process is then repeated for either 30 or 100 generations.

You can use this program to demonstrate a variety of evolutionary processes and conditions, such as the following:
  • Hardy-Weinberg equilibrium:   In a large, random-mating population (i.e., one whose members mate at random), without selection, migration, or mutation, the genetic frequencies of the different alleles will tend to remain constant over time. To demonstrate this, choose a very large population size, and set all fitness values equal to 1.0. Whatever you choose for the starting value of p, it should change very little over time. (Ideally, this applies to an infinitely large population, or to a population large enough that it approximates an infinite population. Natural populations sometimes number into the millions, but a program as realistic as that would run much too slowly. A population size over 10,000 comes close to a Hardy-Weinberg equilibrium, though not exactly.)

  • Natural Selection:   This is best demonstrated in a population of 1000 or more by choosing different fitness values for the different genotypes.
    Various types of selection are possible:
    • Selection against dominants:   If there is true, or complete, dominance, then genotypes AA and Aa should be identical in phenotype (appearance) and should ideally have the same fitness. To demonstrate this, set the fitness of aa to the maximum value of 1.0 and set the fitness of AA and Aa to be equal but lower. Even with a modest disadvantage in fitness, the dominant allele A will disappear quickly from the population.
    • Incomplete dominance   To demonstrate incomplete dominance, set the fitness of the Aa genotype somewhere in between those of the two homozygous genotypes.
    • Selection against recessives:   To show this, set the fitness of AA and Aa to the maximum value of 1.0 and set the fitness of aa to be lower (even as low as 0.0, meaning a lethal trait). Once a recessive trait becomes rare within a large population, its further decline becomes very slow, and it may take thousands of generations to eliminate the trait completely. If mutations re-introduce the trait, it may never disappear from the population, although it will remain very rare.
    • Balanced polymorphism:   These are the cases where the heterozygous genotype is maximally fit and each of the homozygous genotypes is at a comparative disadvantage. Sickle-cell anemia represents a very well-studied case: the aa condition (actually HbSHbS) develops sickle-cell anemia, a condition that was fatal before the development of anti-sickling drugs. The heterozygous condition, Aa ( or HbAHbS) has the highest fitness because these individuals are resistant to the one-celled malaria parasites, and also because the mosquitoes that transmit the parasites avoid biting them. The AA (or HbAHbA) homozygotes are susceptible to malaria, so they have lower fitness in places where there is a lot of malaria. To simulate conditions that prevailed in malaria-prone regions of Africa before the advent of anti-sickling drugs, set the fitness of aa to zero (they die from sickle-cell anemia), set the fitness of the Aa heterozygotes to 1.0 (they are malaria-resistant and thus maximally fit), and set the fitness of AA homozygotes to around 0.85, meaning that they only survive to reproductive age 85% as often as do the Aa heterozygotes. Under these conditions, both alleles will persist in the population indefinitely. Several other inherited diseases are thought to represent similar situations.

  • Genetic drift:   In small populations, allele frequencies may change abruptly and erratically from one generation to the next because of statistical sampling conditions. In very small populations, one allele or the other may be lost, and it may not be possible to predict which one. Therefore, a species that has many small, isolated populations may have some populations that lose one allele while others lose the other allele. To demonstrate genetic drift without selection, set all the fitness values to the maximum of 1.0 but set the population size to be small and run the simulation again and again to demonstrate how different and unpredictable the outcomes may be. You can also combine fitness and drift together: the smaller the population, the more erratic (and unpredictable) the changes will be, even in the presence of modest differences in fitness.