← Chapter 5
Statistics · Chapter 5

Two-Way Tables: Joint, Marginal, and Conditional

A two-way table holds three different kinds of probability at once, and they all share the same counts. The only thing that changes is what you divide by. Build a population with the sliders, draw a real sample, then tap a cell and watch the denominator move from the whole table, to a row, to a column.

Commuter survey — observed counts

The distribution you are reading

Two-way tablespick a probability to read
This sample—
True population value—

The population you are sampling from

400commuters
45%rest split 60/40
72%overall
0.600 = independent
Each commuter is generated one at a time from a seeded pseudo-random generator: first a commute mode, then on-time or late using that mode’s true rate. Nothing in the table is typed in by hand — every count is sampled, so it wobbles the way real data does.