# Wright–Fisher Population Drift & Allele Frequency Tutor

Simulate Wright–Fisher genetic drift across many replicate populations with mutation and selection. Visualize drift trajectories, the final-frequency distribution, heterozygosity decay Hₜ = H₀(1−1/2Nₑ)ᵗ, and run a Hardy–Weinberg chi-square test.

> Canonical page: https://elysiatools.com/en/tools/wright-fisher-population-drift-and-allele-frequency-tutor

- **Category:** Education

- **Keywords:** wright-fisher, genetic drift, allele frequency, fixation probability, heterozygosity, hardy-weinberg, population genetics, kimura, selection coefficient, mutation rate

## Overview

An interactive tutor for the Wright–Fisher model — the canonical null model of random genetic drift. Set a population size N (diploid 2N or haploid N gene copies), an initial allele frequency p₀, an optional mutation rate μ and selection coefficient s with dominant/recessive/additive dominance, then run many replicate populations in parallel. The tool plots every replicate trajectory, the distribution of final frequencies (showing how often A fixes vs is lost), the observed mean heterozygosity against the analytic decay Hₜ = H₀(1 − 1/(2Nₑ))ᵗ, and Kimura's theoretical fixation probability. Optionally paste genotype counts (AA/Aa/aa) to run a Hardy–Weinberg equilibrium chi-square test. Bridges the gap between a single Mendelian Punnett cross and the long-run population-level fate of an allele. Deterministic per seed.

## Inputs

- **Population size (N individuals)** (number)
- **Ploidy** (select)
- **Generations** (number)
- **Replicate populations** (number)
- **Initial frequency of allele A (p₀)** (number)
- **Mutation rate μ (per gene per generation)** (number)
- **Selection coefficient s (>0 favours A)** (number)
- **Dominance of A** (select)
- **Random seed (reproducibility)** (number)
- **Hardy–Weinberg test — AA count (optional)** (number): e.g. 36
- **Hardy–Weinberg test — Aa count (optional)** (number): e.g. 48
- **Hardy–Weinberg test — aa count (optional)** (number): e.g. 16

## When to use

- Explore how population size, ploidy, and starting allele frequency affect genetic drift.
- Compare neutral drift with mutation or selection favoring or opposing allele A.
- Test observed AA, Aa, and aa genotype counts against Hardy–Weinberg equilibrium.

## How it works

- Set population size N, diploid or haploid ploidy, number of generations, replicate populations, and initial allele frequency p₀.
- Optionally enter mutation rate μ, selection coefficient s, and dominant, recessive, or additive dominance for allele A.
- Run the simulation to view replicate trajectories, the final-frequency distribution, heterozygosity against the analytic decay curve, and fixation probability.
- Enter optional AA, Aa, and aa counts to run a Hardy–Weinberg equilibrium chi-square test; use a random seed to reproduce a simulation.

## Use cases

- Teach genetic drift, fixation, and loss of genetic variation in population genetics courses.
- Compare the effects of population size, initial frequency, mutation, and selection across repeated simulations.
- Evaluate whether observed genotype counts are consistent with Hardy–Weinberg equilibrium.

## Frequently asked questions

### What does the Wright–Fisher simulation show?

It shows allele-frequency trajectories across replicate populations, the distribution of final frequencies, heterozygosity decay, and fixation probability.

### What is the role of population size N?

N sets the number of individuals. In diploids, the model uses 2N gene copies; smaller populations generally show stronger random drift.

### Can I model natural selection and mutation?

Yes. Set mutation rate μ and selection coefficient s, then choose dominant, recessive, or additive dominance for allele A.

### What does a random seed do?

A seed makes the stochastic simulation deterministic, so the same settings and seed can reproduce the same result.

### How do I run the Hardy–Weinberg test?

Enter the observed counts for AA, Aa, and aa. The tool uses these genotype counts for a Hardy–Weinberg equilibrium chi-square test.

## Related tools

- [Fraction / Decimal / Percent Visual Tutor](https://elysiatools.com/en/tools/fraction-decimal-percent-visualizer): One value, three linked notations — pie, bar, percent grid and number line — with a live-synced slider, exact repetend detection and practice exercises.
- [Punnett Trihybrid & Dihybrid Cross Visualizer](https://elysiatools.com/en/tools/punnett-trihybrid-cross): Compute 2-3 gene Mendelian crosses with a full Punnett square and forked-line branch diagram. Supports complete, incomplete and codominance inheritance.
- [Multiplicity of Infection (MOI) Calculator](https://elysiatools.com/en/tools/moi-calculator): MOI from titer/volume/cells or the virus volume for a target MOI, with Poisson % infected. Educational use only.
- [Peptide Mass Calculator (Monoisotopic/Average)](https://elysiatools.com/en/tools/peptide-mass-calculator): Sums ProtParam residue masses for a peptide sequence (mono or average) and reports M, \[M+H\]⁺, \[M+Na\]⁺, \[M+2H\]²⁺. Educational use only.
- [Pet Age Converter](https://elysiatools.com/en/tools/human-age-to-dog-cat-years): Convert a dog or cat's age into human-equivalent years using the modern AVMA method (with breed-size grouping for dogs) or the UCSD epigenetic formula, and see the pet's life-stage milestone plus a printable vet-visit summary card.
- [Absorbance↔Transmittance Converter (A = −log₁₀T)](https://elysiatools.com/en/tools/absorbance-transmittance-converter): Convert A ↔ %T ↔ T with A = −log₁₀(T) and %T = 100·T; returns all three representations for spectrophotometry work.
- [PCR Annealing Temperature Calculator (Ta = Tm − 5°C)](https://elysiatools.com/en/tools/annealing-temperature-calculator): PCR Ta by the simple rule (lower primer Tm − 5°C) or the Rychlik 1990 formula (0.3·Tm_primer + 0.7·Tm_product − 14.9), with a ±3°C gradient window and primer-Tm mismatch warning. Derived from Rychlik 1990, Innis & Gelfand 1990, Lorenz 2012. Lab-planning use only.
- [Autosomal Dominant Pedigree Analyzer](https://elysiatools.com/en/tools/autosomal-dominant-pedigree): Compute AD offspring risk (Aa×aa 1:1, Aa×Aa 3:1, AA×any all affected), chi-square fit of observed children, and hallmark checks including male-to-male transmission that rules out X-linked dominant. Derived from Griffiths, Hartl & Clark 2007, StatPearls, OMIM. Educational use only.

## Samples

- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
