Recipe
Check whether two random variables are independent
Use when: you have a full joint table for X and Y and need a definitive verdict, yes or no, on whether p(x,y)=p_X(x)p_Y(y) holds at every cell
Goal: either a confirmed yes, checked at every cell, or a specific cell that disproves it
Taught in Independence of random variables
Quick recipe
-
1
Sum each row of the joint table to get p_X(x) for that row, and sum each column to get p_Y(y) for that column.
Example
A joint table has p(0,0)=0.06, p(0,1)=0.14, p(1,0)=0.24, p(1,1)=0.56. Summing row 0 gives p_X(0)=0.06+0.14=0.20, and row 1 gives p_X(1)=0.24+0.56=0.80. Summing column 0 gives p_Y(0)=0.06+0.24=0.30, and column 1 gives p_Y(1)=0.14+0.56=0.70.
Why: the marginals are the very quantities the product rule needs on its right-hand side, and they exist whether or not X and Y turn out to be independent.
-
2
For every cell in the table, multiply its row's marginal by its column's marginal. That product is the joint probability the cell would HAVE to equal for independence to hold there.
Example
Continuing the same table: 0.20(0.30)=0.06, 0.20(0.70)=0.14, 0.80(0.30)=0.24, 0.80(0.70)=0.56.
Why: this is the product rule p_X(x)p_Y(y) from the definition, computed once for every cell before comparing anything.
-
3
Go cell by cell and compare the joint table's actual value to the product just computed. The moment any cell fails to match, stop, independence is already disproven, and there's no need to check the rest.
Example
Continuing the same table, all four cells match exactly: 0.06=0.06, 0.14=0.14, 0.24=0.24, 0.56=0.56. Every cell held up, so X and Y are independent.
- every cell matches, all the way through — conclude X and Y are independent.
- one cell doesn't match — conclude X and Y are NOT independent immediately, and report that cell.
⚡ Shortcut
If the goal is only to DISPROVE independence, don't walk through every marginal first. Pick one cell that looks likely to fail — often a corner cell, or one where the joint probability looks unusually large or small next to its row and column. Compute just that one product, and compare. One mismatch already ends the problem, so there's no need to build out the whole table of products unless that first check happens to pass.
Why: the definition requires the product rule to hold at EVERY pair, so one match is never enough to prove independence, but one failure is already enough to disprove it.
Common mistakes
- Concluding independence after checking only one or two cells that happen to match, without checking the rest of the table.
- Multiplying the wrong pair of marginals, such as a row marginal by a different row's own column marginal.
- Continuing to check remaining cells after already finding a mismatch, when the verdict is already settled.
- Treating "the row and column marginals each sum to 1" as evidence of independence; marginals are computed the same way regardless of whether the variables are independent.