created with NetLogo
view/download model file: hw-lg.nlogo
Hardy-Weinberg simulator
The Hardy-Weinberg model of population genetics allows for the prediction of the next generation's genotype frequencies from the frequencies in the current generation, given that there is no selection, genetic drift, migration, or mutation. In other words, it describes how genotype frequencies in a population change in the absence of evolution.
Individuals in this simulation vary between two alleles at a single locus. One allele is completely recessive to the other. The recessive trait is green, and the dominant trait is pink.
Specify the initial genotype frequencies and create the initial population. In each generation, each diploid individual disperses, releases gametes, and dies. Gametes then combine to form the next generation of diploid individuals. The plot tracks the genotype frequencies over the generations.
Exercises and questions: Choose arbitrary numbers for the initial genotype numbers. Use the Hardy-Weinberg model and predict mathemtaically what the next generation's genotype frequencies should be. Does the model behave as you predicted? Probably not, because of differences between the simulation and the idealized Hardy-Weinberg population. Can you modify your initial genotype numbers to better approximate the ideal? (Also try the simulator "hw-sm." It works better. Why?) If you began with identical numbers of homozygous-recessive and homozygous-dominant individuals, one of the plot lines for the homozygous genotypes will always be completely obscured by the other. Why do the homozygote frequencies track each other so precisely in this case?
(Ted Wong, twong@brynmawr.edu, Dec. 2002)