Natural Selection Lab: Alleles Across Generations

Change genotype fitness and starting allele frequency to follow selection with random mating in an illustrative population.

Free, with no sign-up.

For High school students and adults reviewing the topic.

About 10 minutes.

How does it work?

  1. Change the controls or open a named preset. Read the outputs, then check a challenge.

What will you get?

Compare the model’s outputs and check two challenges.

What does the model assume?

  • This deterministic model follows alleles A and a in a large diploid population with random mating, no mutation, no migration, and no genetic drift.
  • Each cycle starts with offspring frequencies p², 2p(1 − p), and (1 − p)². Selection weights these by the relative fitnesses of AA, Aa, and aa, then normalizes surviving contributions.
  • The next allele frequency is [p²wAA + p(1 − p)wAa] divided by the mean fitness. Random mating forms the next generation from this frequency.
  • Final genotype outputs describe offspring before selection. Fitness is relative reproductive contribution, not a measure of strength or moral value. Fitnesses stay constant.
  • At least one present genotype must have positive fitness. Otherwise no population reproduces and the controls produce no result.
  • The crossing output is the first generation strictly above the selected frequency, including generation zero. If it is not reached within the chosen interval, no generation is reported.

Which setup would you like to try?

What can you change?

Range: 0 to 1 .

Range: 0 to 2 .

Range: 0 to 2 .

Range: 0 to 2 .

Range: 1 to 100 .

Range: 0 to 1 .

What does the model predict?

QuantityValueUnit
Final frequency of A0.9022
Final offspring frequency of AA0.8139
Final offspring frequency of Aa0.1765
Final offspring frequency of aa0.0096
First generation above the target3
Allele frequency by generation
0050.25100.5150.75201GenerationFrequency of A

A starts at 0.4 and ends at 0.9022 after 20 generations.

Solid line: allele frequency. Dashed line: frequency to exceed.

Frequency in each generation
GenerationFrequency of A
00.4
10.487805
20.561452
30.621186
40.669201
50.707935
60.739475
70.765451
80.787102
90.805353
100.820904
110.834284
120.845899
130.856064
140.865024
150.872976
160.880076
170.886451
180.892203
190.897417
200.902164

Can you reach these targets?

Start A at 0.40. Set each genotype’s relative fitness to 1 so its frequency stays 0.40 for 20 generations.

  • Target: Starting frequency of A = 0.4 ; tolerance 0 .
  • Target: Relative fitness of AA = 1 ; tolerance 0 .
  • Target: Relative fitness of Aa = 1 ; tolerance 0 .
  • Target: Relative fitness of aa = 1 ; tolerance 0 .
  • Target: Generations = 20 ; tolerance 0 .
  • Target: Final frequency of A = 0.4 ; tolerance 0.000001 .

Start A at 0.50. With fitnesses 1 for AA and Aa, remove the reproductive contribution of aa. Find A’s frequency after one generation.

  • Target: Starting frequency of A = 0.5 ; tolerance 0 .
  • Target: Relative fitness of AA = 1 ; tolerance 0 .
  • Target: Relative fitness of Aa = 1 ; tolerance 0 .
  • Target: Relative fitness of aa = 0 ; tolerance 0 .
  • Target: Generations = 1 ; tolerance 0 .
  • Target: Final frequency of A = 0.6666666666666666 ; tolerance 0.000001 .
Read the topic guide