BIO 202, Spring 2026, draft v1. Hamilton's rule: r·b > c. The first lesson where the right unit of selection isn't always the individual.
Set up a selfish population. Add an altruism allele. Find the r·b = c boundary. Apply to haplodiploid bees, where r = 0.75 between sisters predicts worker sterility.
Drop an altruism allele into a population of strangers. r is effectively zero. Stages B–D add Hamilton's machinery; this stage is what the trajectories look like before any of it switches on.
An altruism allele is introduced at frequency 0.1 in a population where no one is related to anyone else (r = 0). The allele pays the cost c and gets nothing back from a random partner. With no kin structure, there is nothing for Hamilton's rule to bite on. Each replicate is one possible future.
set.seed(42)N <- 500; gens <- 100; p <- 0.1for (g in 1:gens) p <- rbinom(1,2*N,p)/(2*N)
Altruist allele costs c to the bearer; provides benefit b to a relative with relatedness r. Watch frequency trajectories.
Pairs of individuals interact. With probability r, each pair shares the altruism allele (they're related). The altruist pays c to give benefit b to its partner. Track allele frequency over generations.
set.seed(42)N <- 500; r <- 0.5; b <- 0.3; cc <- 0.1; p <- 0.2; gens <- 200# Mean fitness of altruist: 1 - c + r*b (recipient has altruist allele w.p. r)# Mean fitness of selfish: 1 + p*r*b (gets benefit from altruistic relatives at rate p*r... simplified)for (g in 1:gens) { w_alt <- 1 - cc + r * b w_sel <- 1 p_new <- p * w_alt / (p * w_alt + (1-p) * w_sel) p <- rbinom(1,2*N,p_new)/(2*N)}
Map the (b, c) phase plane at fixed r. Above the r·b = c line, altruism spreads. Below, it doesn't. Move the r slider; watch the line tilt.
The line r·b = c divides the (b, c) plane into two regions. With r = 0.5, the line is c = 0.5·b: altruism spreads only when the benefit is at least twice the cost. With r = 1 (clones), any net benefit spreads. With r = 0 (strangers), nothing spreads.
r <- 0.5; b <- 0.6; cc <- 0.2r*b > cc # Hamilton's rule satisfied?
Hamilton's rule (r·b > c) doesn't care what kind of organism you are. The rule is invariant; the relatedness values are not. Compare three inheritance systems and watch who the rule says to help.
Same Hamilton's rule for all three. Different relatedness values for each because of how they inherit DNA:
For each, ask: with a fixed (b, c), which kin is it most worth helping?
# Three inheritance systems; one rule.diploid <- c(sister=0.5, daughter=0.5, brother=0.5)haplo <- c(sister=0.75, daughter=0.5, brother=0.25)clonal <- c(sister=1, daughter=1, brother=1)# Hamilton's rule: helping spreads if r * b > c, regardless of which row you're in.