View on GitHub


Recessive and dominant gene profileration simulation

Download this project as a .zip file Download this project as a tar.gz file


This simulation is a toy to help explore and understand random trait and gene proliferation.

There are common misconceptions in the biology classroom about recessive traits.



A neutral gene's chance of going extinct has nothing to do with its dominance

graph for chance to go extinct

Dominance affects trait prevalence

graph for recessive vs dominant gene demographics

TraitSim Explained

People are illustrated as a pair of dots. One colored dot per gene. If the brown eyed gene is present it will appear in front of the blue eyed gene.

Each "sex" generation causes the entire population to randomly pair up and make 2 children. The results are visible in the bar graphs at the bottom left. Note that when 2 parents mate, each gene from the parent is equally likely to be inherited.

After leaving the "sex party" on for enough time, most likely one of the gene types will become extinct. The gene type with the lower current gene count is more likely to decrease further. During a tie with 50% blue vs 50% brown genes, there are likely to be 25% with blue eyes and 75% with brown eyes.

Note that eye color isn't really determined by one or two genes.


Expected extinction statistics for extinction in TraitSim (100 people always have 2 kids with equal initial gene counts):

Animated and drawn with the Paper.js framework.

Live demo