Lesson 26 — The Price equation — splitting Δz̄ into two covariances UNIT 5 CORE

BIO 202, Spring 2026, draft v0. The master equation. Names what the course has been doing the whole time, then unlocks it at two levels at once.

Draft skeleton. Stage scenarios and anchor quotes are in place; the simulator and code panels are not yet wired.
Selection is the correlation. Drift is the scatter around it. There's the deterministic part — the amount to which the trait covaries with fitness, with differential reproduction. And there's the random error. Because no matter how much your trait covaries with fitness, there's going to be random stuff where things get struck by lightning. You might have a gene that makes your heart great. That doesn't help you if a tiger ate you. — 202_lec11_01

A — One level: Δz̄ = cov(w, z) / w̄

Build a population of agents with trait z and fitness w(z). Compute cov(w, z). This is the entire engine of selection at one level — and you've been computing this quantity, under different names, since Lesson 5.

Δz̄  =  cov(w, z) / w̄
Many things in biology are just linear regressions. That's why I hammer linear regressions. Way more things in the world are linear regressions than people realize. If you get good at them and understand them, so many things in so many classes become easier. — 202_lec20_01
TODO: one-level Price sim. Population with z trait; w(z) selection function; cov(w,z) readout; Δz̄ comparison to expected.

B — Two levels: groups, between and within

Assemble agents into groups with assortment r. Group fitness W_k depends on group trait composition. Now there are two covariances:

Δz̄  =  cov(W_k, Z_k)  +  E_k[ cov(w_i, z_i | k) ]
                      between groups          within groups
Selection operates at the species level — species that make more of themselves become more common. At the individual level — individuals that make more of themselves become more common. At the cellular level — cancer cells outcompete normal cells. At the genomic level — transposons jump around making more copies of themselves. All of this is manifesting at the same time. We're used to thinking about one level. The unit of selection depends on the scope. — 202_lec29_03
TODO: two-level Price sim. Sliders for s_within, s_between, r (relatedness), p (policing). Both cov terms readout. Stacked-bar visualization of which term dominates.

C — The diagnostic: which level is selection at?

The ratio of the between-group term to the within-group term gives the diagnostic. When it crosses 1, the group becomes the unit of selection. Permutation null: shuffle group membership and see how often the between term beats the within term by chance — the same shuffle test from Lesson 5, just at a different level.

unit_of_selection  =  "group"  ⇔  cov(W_k, Z_k) / E_k[ cov(w_i, z_i | k) ]  >  1
Fitness is not the number of children you have. I've never defined it that way. It's the number of copies of yourself in the next generation. If your brothers and sisters make lots of copies of themselves, there are copies of your genes in the next generation — even if you have no children of your own. Self is your genes, not just your body. — 461_lec28_04
TODO: permutation null on the cov ratio. Show null distribution; tail fraction as the diagnostic P-value for "selection is at the higher level."

D — Re-derive Hamilton's rule

Swap w(z) for the Hamiltonian altruism form: w(z) = 1 − c·z + b·z̄_k. The agent pays a cost c for being a cooperator, but every cooperator in its group raises group fitness by b per cooperator. Recompute both Price terms. Algebra falls out:

altruism favored  ⇔  b · r  >  c

Lesson 17's rule, derived from the Price machinery the student just built.

Everything you learned in intro biology — all of it evolved. Meiosis evolved and is evolving. Mitosis is evolving. Plasma membranes, ribosomes, DNA replication — everything evolved. Mutation rates evolved. The fundamental parts of biology are not set in stone. They're set in DNA, and DNA evolves. The hard and fast rules in biology are the ones in evolution — because those describe how all the other rules change. Everything else is just the consequence of "more copies of yourself means more of you" plus drift plus errors over time. — 461_lec29_05
TODO: Hamilton-from-Price derivation. w(z) = 1 − c·z + b·z̄_k; show b·r > c falling out algebraically. .R export. Non-trivial code mod: extend to three levels (gene-within-individual, individual-within-group, group-within-population) and watch the ratios cascade.