Sample Size and Apparent Fairness

A small run of a fair process can produce counts that look unequal. A useful check describes what variation the assumed process predicts.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Calculate an extreme case
  2. Choose a repeatable criterion
  3. Compare observations against a concrete chance model
  4. Decide which outcomes count as equally extreme

Calculate an extreme case

In four independent fair coin tosses, all heads occurs with probability one sixteenth. All tails has the same probability. Either extreme therefore occurs one time in eight under the model. Binomial probabilities give the exact counts.

Choose a repeatable criterion

Seeing an extreme outcome alone does not identify biased code. Use many independent runs, document the generator, and compare with a predetermined measure. Simulation and enumeration can validate the test setup.[1]

Compare observations against a concrete chance model

Under independent fair flips, exactly four heads in five trials has probability \(5/32\). At least four has probability \(6/32\), adding the all-heads case. A high observed proportion at this size is therefore unsurprising. See small binomial samples.

Four heads: 5 strings × 1/32 = 5/32
Five heads: 1 string × 1/32 = 1/32
At least four heads: 6/32 = 18.75%

Decide which outcomes count as equally extreme

A two-sided fairness assessment generally considers unexpectedly few heads as well. Pick the sampling plan before examining results, and preserve the count of all trials. Repeatedly checking after many sample sizes changes the interpretation of a simple fixed-sample calculation.

References

  1. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩