Natural selection
Natural selection changes the frequencies of heritable types when those types differ in reproductive success. Mathematics lets us describe exactly how those frequencies change across generations.
Two types
Let \(p\) be the frequency of type \(A\), and let \(1-p\) be the frequency of type \(a\). If their fitnesses are \(w_A\) and \(w_a\), the population mean fitness is
\[\bar{w}=p w_A+(1-p)w_a.\]After selection, the frequency of \(A\) is
\[\boxed{p^{\prime}={p w_A\over \bar{w}}}.\]The division by mean fitness normalises the reproductive contributions so that the new frequencies sum to one.
General selection equation
For types indexed by \(i\),
\[\boxed{p_i^{\prime}={p_iw_i\over\bar{w}}},\qquad \bar{w}=\sum_jp_jw_j.\]A type with fitness above the current population mean increases in frequency.
Selection coefficient
For a simple directional-selection model, set
\[w_A=1+s,\qquad w_a=1,\]where \(s\) is the selection coefficient. Then
\[\bar{w}=1+sp\]and therefore
\[\boxed{p^{\prime}={p(1+s)\over1+sp}}.\]The one-generation change is
\[\boxed{\Delta p={sp(1-p)\over1+sp}}.\]For \(s>0\), the change is positive whenever \(0
Allele frequency across generations
Starting at \(p_0\), repeated selection is described by
\[p_{n+1}={p_n(1+s)\over1+sp_n}.\]Exact discrete solution
The odds of allele \(A\) are
\[O_n={p_n\over1-p_n}.\]Because selection multiplies these odds by \(1+s\) each generation,
\[O_n=O_0(1+s)^n.\]Hence
\[\boxed{p_n={p_0(1+s)^n\over1-p_0+p_0(1+s)^n}}.\]This is the exact solution of the discrete-generation model with constant relative fitnesses \(1+s\) and \(1\).
Why the increase is S-shaped
When the favoured allele is rare, there are few copies on which selection can act. At intermediate frequencies, the change becomes larger. Near fixation, little of the alternative allele remains, so the increase slows again.
Continuous-time model
A corresponding continuous model is
\[\boxed{{dp\over dt}=r p(1-p)}.\]Its solution is
\[\boxed{p(t)={p_0e^{rt}\over1-p_0+p_0e^{rt}}}.\]For weak selection, one often uses \(r\approx s\). However, if we want the continuous curve to pass through the exact same frequencies at every integer generation as the discrete model, the correct rate is
\[\boxed{r=\ln(1+s)}.\]This follows because \(e^r=1+s\).
Discrete and continuous selection compared
The comparison below uses \(p_0=0.1\) and \(s=0.08\). The discrete model uses the exact generation recurrence. The continuous curve uses \(r=\ln(1.08)\), so both models agree exactly at integer generations.
Diploid selection
For alleles \(A\) and \(a\), random mating gives pre-selection genotype frequencies
\[AA:p^2,\qquad Aa:2p(1-p),\qquad aa:(1-p)^2.\]With genotype fitnesses \(w_{AA}\), \(w_{Aa}\), and \(w_{aa}\), mean fitness is
\[\bar{w}=p^2w_{AA}+2p(1-p)w_{Aa}+(1-p)^2w_{aa}.\]The allele frequency after selection is
\[\boxed{p^{\prime}={p^2w_{AA}+p(1-p)w_{Aa}\over\bar{w}}}.\]Dominance
A common parameterisation is
\[w_{AA}=1+s,\qquad w_{Aa}=1+hs,\qquad w_{aa}=1.\]The parameter \(h\) describes how strongly the selective effect appears in the heterozygote. Dominance can substantially alter how quickly a beneficial allele changes when rare.
Balancing selection
If the heterozygote has greater fitness than either homozygote, selection can maintain both alleles. More generally, frequency-dependent fitness can also create an internal equilibrium at which competing types have equal effective fitness.
Selection and genetic drift
The equations above are deterministic. In a finite population, reproduction is random, so genetic drift also changes allele frequencies. A beneficial allele can therefore disappear by chance when it is rare even though deterministic selection favours it.
Selection, mutation and migration
Mutation creates or converts types, while migration moves types between populations. Selection changes their relative representation through differential reproductive success. Models can combine these processes when the biological question requires them.
Fitness is context-dependent
Fitness is not an absolute property of a genotype. It depends on the environment, competing types and the reproductive outcome represented by the model. A type can therefore be favoured under one set of conditions and disfavoured under another.