Selection + Drift Simulator

Selection + Drift Simulator

Simulates allele frequency change when selection and genetic drift act together. Each generation first applies selection using genotype fitness values, then applies Wright–Fisher sampling in a finite population.

Selection step: p* = (p²wAA + pqwAa) / w̄   |   w̄ = p²wAA + 2pqwAa + q²waa
Drift step: next generation A alleles ~ Binomial(2N, p*)   |   p(next) = sampled A / 2N

Inputs

This simulator applies selection first and then drift within each generation. The columns p², 2pq, and q² are Hardy-Weinberg reference values based on the allele frequency at the start of that generation.

Results

Check pending
Starting p
Starting q
Generations Simulated
Final p
Final q
First Generation w̄
Interpretation
Generation p q A alleles a alleles 2pq p after selection A after drift p(next)
No simulation yet