Running tally — Aa count
What you just did has a name
HWE gives three expected counts as functions of p and N:
AA = p²·N, Aa = 2pq·N, aa = q²·N.
You predicted the middle one five times. In round 1 (panmictic
simulation) the observed count sat exactly on HWE. In round 2 (a
pedigreed wild population) it sat slightly below — a small positive
F — because some parents are related. In round 3 (a sibling
mating colony) the heterozygote count was far below HWE — a large
positive F. Round 4 (two populations fixed for opposite
alleles, pooled) had zero heterozygotes despite p = 0.5 —
F = 1. Round 5 reversed direction: you recovered p
from counts and computed a partial inbreeding value.
F = 1 − Hobs / Hexp is the detection tool. It tells you a population is not in HWE. It does not tell you which cause produced the deviation: inbreeding, assortative mating, or pooled subpopulations (Wahlund effect). Round 3 was the first. Round 4 was the third. Same F, different biology. You distinguish them with other evidence — pedigree, mating data, substructure.
This is null-model reasoning in miniature: HWE holds when five assumptions hold; every violation shows up as a deviation from Hexp. Rejecting HWE tells you something is happening. The scaffold's job is to make that reflex automatic.