Loading…

Genetic Drift Simulation

Biology • Population Genetics

View all topics

Simulation inputs

Each generation samples \(2N\) alleles.
q0 = 1 − p0.
Max 500 here to keep charts fast.
Try 10–200 replicates to see variability.
Same seed → same simulated trajectories.
Speeds simulation and makes fixation/loss obvious.
Genetic drift as random sampling: \[k \sim \text{Binomial}(2N,\,p),\] \[ p'=\frac{k}{2N}\]
Even with the same starting p0, replicate runs diverge purely by chance.

Graph options

Hover the plot for generation-specific values; zoom and pan are enabled.
Hover bars for counts and percentages.
If blank, the plot highlights the nearest run under your cursor.
Useful when R is large and lines are very dense.
Paste or upload CSV (settings)
Paste one row (headers allowed). Supported order: \[ N,\ p0,\ generations,\ replicates,\ seed,\ stopFix \]
stopFix: 1 = yes, 0 = no. Delimiters: comma, semicolon, or tab.

Paste

Upload

Run

Graphs and steps appear after Calculate.
Ready

Rate this calculator

5.0 /5 (2 ratings)
Your rating
You can update your rating any time.

Recent reviews

2 reviews
Anonymous
5/5

very useful

Anonymous
5/5

nice

Frequently Asked Questions

What does the genetic drift simulation calculator do?

It simulates random allele-frequency change in a finite diploid population with no selection, mutation, or migration. The tool runs replicate trajectories across generations and summarizes fixation, loss, and the distribution of final p values.

What model is used for genetic drift in this simulation?

Each generation samples 2N allele copies with k ~ Binomial(2N, p_t), then updates p_{t+1} = k/(2N). Random sampling alone causes different replicate trajectories even with the same starting p0.

Why do some runs reach fixation or loss?

In a finite population, sampling noise can push p toward 0 or 1 over time. Once p hits 0 (loss) or 1 (fixation), those boundaries are absorbing in this model, meaning the run stays there.

How does population size N affect drift strength?

Smaller N produces larger sampling variance per generation, so trajectories spread out faster and fixation/loss tends to happen sooner. In the binomial model, Var(p_{t+1} | p_t) = p_t(1 - p_t)/(2N).

How can I reproduce the same simulation results?

Enter the same inputs and provide the same random seed. Using a seed makes the random number sequence repeatable, so the simulated trajectories match across runs.