Introduction
A joint probability table records how often pairs of values occur in a probability model. It also lets us check whether knowing the value of one random variable changes the probability distribution of another. The key comparison is between a joint probability and the product of the two corresponding marginal probabilities.
The earlier material on Independence of Discrete Random Variables introduces independence as a property of two variables’ joint distribution. Here we make that property practical: we calculate the margins of a table, compare its entries with products of margins, and decide whether the factorization holds.
Reading a Joint Probability Table
Suppose \(X\) and \(Y\) are discrete random variables. A joint probability table places possible values of \(X\) in rows, possible values of \(Y\) in columns, and the probability \(P(X=x_i,\;Y=y_j)\) in each cell. Each cell describes the probability that both variables take the specified values at the same time.
The marginal probability of one value is found by adding the joint probabilities across the corresponding row or column. If \(X\) has row values \(x_1,\ldots,x_r\) and \(Y\) has column values \(y_1,\ldots,y_c\), then
A table is a valid joint probability table if every cell is nonnegative and all cells sum to 1. The row and column sums are probabilities too, so they must each be between 0 and 1. Checking these basics matters: an invalid table cannot describe the joint distribution of two random variables.
Compare corresponding probabilities: a cell for \((x_i,y_j)\) is checked against the product of the margin for \(x_i\) and the margin for \(y_j\). If even one cell fails to match, the variables are dependent. If every cell matches, they are independent. A match in just one cell does not settle the question.
Why the Cellwise Criterion Works
Independence means that probabilities for events about \(X\) and \(Y\) factor into the product of the separate event probabilities. The cellwise criterion is a precise table-based way to check this condition. To see why, suppose the criterion holds for every cell. Let \(A\) be a set of possible values of \(X\), and \(B\) a set of possible values of \(Y\). Add the cells whose \(X\) values are in \(A\) and whose \(Y\) values are in \(B\):
Thus, if every cell factors, probabilities for any sets of values factor as well. Conversely, independence applied to the events \(X=x_i\) and \(Y=y_j\) requires the factorization for each cell. This is why checking all cells is both necessary and sufficient.
A Systematic Check
For a small table, use the following procedure. Keep enough precision during the calculations to distinguish genuine mismatches from rounding.
Confirm that the entries are nonnegative and sum to 1.
Add each row to obtain the probabilities for \(X\), and each column to obtain the probabilities for \(Y\).
For each cell, multiply its row marginal by its column marginal and compare the result with the joint probability in that cell.
If any exact comparison fails, the variables are dependent. If all comparisons hold, they are independent.
The comparison concerns the probability model represented by the table, not a statistical test based on a sample. It does not use a significance level or a p-value. If entries are rounded, apparent small differences may be rounding artifacts; whenever possible, perform the check using the unrounded probabilities.
Worked Example: Every Cell Factors
Suppose a hypothetical probability model records whether a device is in mode \(X=0\) or \(X=1\), and whether a signal has type \(Y=A\) or \(Y=B\). The entries below are joint probabilities.
| \(Y=A\) | \(Y=B\) | \(P(X=x_i)\) | |
|---|---|---|---|
| \(X=0\) | 0.18 | 0.12 | 0.30 |
| \(X=1\) | 0.42 | 0.28 | 0.70 |
| \(P(Y=y_j)\) | 0.60 | 0.40 | 1.00 |
The four joint probabilities sum to \(0.18+0.12+0.42+0.28=1.00\), and each is nonnegative. The row and column sums in the margins follow from adding the corresponding cells.
Check each cell against the product of its margins:
All four products equal their corresponding joint probabilities. Therefore, \(X\) and \(Y\) are independent in this hypothetical model. For instance, the probability that the device is in mode 0 and the signal is type A is \(0.18\), exactly the product of the separate probabilities \(0.30\) and \(0.60\).
Worked Example: A Single Mismatch Establishes Dependence
In another hypothetical model, \(X\) records whether a sensor is in state 0 or 1, and \(Y\) records whether a reading is category A or B. The joint table is:
| \(Y=A\) | \(Y=B\) | \(P(X=x_i)\) | |
|---|---|---|---|
| \(X=0\) | 0.10 | 0.20 | 0.30 |
| \(X=1\) | 0.30 | 0.40 | 0.70 |
| \(P(Y=y_j)\) | 0.40 | 0.60 | 1.00 |
The entries are nonnegative and sum to \(1.00\). Using the row and column margins, the products for the four cells are
These products do not equal the corresponding joint probabilities \(0.10,\;0.20,\;0.30,\;0.40\). In particular, for the first cell, \(P(X=0,Y=A)=0.10\), while \(P(X=0)P(Y=A)=0.12\). One mismatch is enough to conclude that \(X\) and \(Y\) are dependent. In this model, the joint distribution does not factor into the two marginal distributions.
Worked Example: A Multi-Value Variable
Suppose a hypothetical model records a count \(X\in\{0,1,2\}\) and a status \(Y\in\{0,1\}\). Its joint probability table is:
| \(Y=0\) | \(Y=1\) | \(P(X=x_i)\) | |
|---|---|---|---|
| \(X=0\) | 0.20 | 0.10 | 0.30 |
| \(X=1\) | 0.10 | 0.20 | 0.30 |
| \(X=2\) | 0.20 | 0.20 | 0.40 |
| \(P(Y=y_j)\) | 0.50 | 0.50 | 1.00 |
The six cells sum to \(1.00\), and the margins give \(P(Y=0)=P(Y=1)=0.50\). For \(X=0\), the product for either column is \((0.30)(0.50)=0.15\), which differs from both joint probabilities \(0.20\) and \(0.10\). That mismatch is already enough to establish dependence.
Checking the rest shows why a partial check can mislead. For \(X=1\), both products are \((0.30)(0.50)=0.15\), while the joint probabilities are \(0.10\) and \(0.20\). For \(X=2\), both products are \((0.40)(0.50)=0.20\), matching both joint probabilities in that row. The matching cells for \(X=2\) do not make the variables independent: the mismatches in other rows show that factorization fails.
Zero Probabilities and Common Pitfalls
A zero marginal requires no special division. If \(P(X=x_i)=0\), then every joint probability in that row must be zero, since the row consists of nonnegative probabilities that sum to zero. The product \(P(X=x_i)P(Y=y_j)\) is also zero in every column. The cellwise criterion therefore remains valid even when a marginal is zero.
A related mistake is to divide a joint probability by a marginal without checking whether that marginal is positive. Conditional probabilities such as \(P(Y=y_j\mid X=x_i)\) require \(P(X=x_i)>0\). The product criterion avoids that division and can be applied directly to every cell.
- Wrong reasoning: “One cell matches its product, so the variables are independent.” Correction: Independence requires every cell to match.
- Wrong reasoning: “The table looks balanced, so the variables must be independent.” Correction: Calculate the margins and compare the exact cell values with the products.
- Wrong reasoning: “The products are close, so the variables are independent.” Correction: For an exact probability table, independence is an exact factorization property. If only rounded entries are available, rounding may obscure the conclusion.
- Wrong reasoning: “A mismatch tells us that one variable causes the other.” Correction: A mismatch shows dependence in the probability model, not causation.
Check Your Understanding
Use the cellwise product criterion to reason through these questions.
- A joint table has nonnegative entries that sum to 1. What two sets of sums must you calculate before checking independence?
- For one cell, the joint probability is 0.08 and the corresponding marginal probabilities are 0.20 and 0.40. Does this cell agree with the independence criterion? Show the product.
- If three cells in a table match their products but a fourth does not, what can you conclude about the variables?
- Why does a cell with joint probability 0 automatically match the independence criterion if one of its marginal probabilities is zero?
- Does a mismatch in a joint table establish that one random variable causes the other? Explain.