Statistics

Joint, Marginals & Conditionals

Two numbers come out of one experiment, so every pair of values gets its own probability: a table of little squares whose areas add to one. Drag a box over the pairs you care about and one selection answers all three questions at once. The squares you enclosed are the joint, the bar each edge stacks up is a marginal, and that same bar divided by its own total is a conditional.

opposedindependenttogether
P(A)  the columns
P(B)  the rows
P(A and B)
P(A) × P(B)
P(B | A)
Everything adds to

Drag a box across the table to choose an event. Every square is one pair (x, y) and its area is that pair's probability, so the whole table has area one. Drag a box a full column wide to get the textbook marginal.

What to observe

  1. Leave the link at independent and drag a box around. Whatever you pick, P(A and B) and P(A)×P(B) come out equal. That equality is the definition of independence, not a fact about the world.
  2. Look at the bar under a selected column. It is literally that column stacked up, one segment per cell, and its full height is P(x): summing a variable out is that, and nothing more. The amber part of the stack is the slice your box actually kept, so P(A and B) is visible on the margin itself as a piece of P(A).
  3. Every marginal bar is shorter than one, and all of them together add to one. A marginal is a share of the whole table, not a distribution over the column. Divide it by its own total and it adds to one again: that is the conditional in the lower half of the card, and the shape never changed, only the scale.
  4. The highlighted bars of that conditional add to P(B | A), which is the same P(A and B) you started with, now measured against P(A) instead of against the whole table. One box, three readings.
  5. Now slide the link towards together. The mass piles onto the diagonal, a box on the diagonal holds more than the product predicts, and the conditional visibly leans as you slide the box across the columns. Under independent it never moves at all: that is what independence looks like from here.
  6. Push the link to opposed. Now a diagonal box is unusually empty, and the product overestimates instead. Dependence has a direction, and the product test does not care which.

Shortcuts: space run/pause · s step · r reset · f fullscreen