Two separately built devices produce random outputs. The first gives , equal to or with probabilities and , and the second gives , equal to , or with probabilities , and . These two lists do not yet answer a joint question such as how likely it is that while , because the answer depends on how the outputs occur together. When the devices operate independently, the probability of each pair of values is the product of the two marginal probabilities. This lesson states that product law precisely, tests joint tables against it at every cell and every CDF threshold, and separates pairwise independence from mutual independence.
Key terms
Independent random variables
Definition Let and be discrete random variables on the same probability model. They are independent if every event described by alone is independent of every event described by alone, that is, if
for all sets and of real numbers, where the left side is the probability that both events occur. Events with probability satisfy this product rule automatically, so independence is equivalent to for every set and every set with . Independence is a property of the joint distribution of the pair. In general it cannot be read from the two marginal distributions, and it does not follow from the variables having different names or different descriptions.
In plain words Learning any fact about alone, as long as that fact has positive probability, leaves the probabilities for unchanged, and the same holds the other way around. In a model this is either assumed, for example for devices that operate separately, or checked against the joint distribution.
Example Assume the two devices from the opening operate independently. Taking and shows that each cell of the joint table is a product of a probability for and a probability for .
The event has probability , so , and the two qualifying cells of the second row give the same total . Dividing the second row by its total gives , and , which is the distribution of itself. Dividing the first row by gives the same three numbers, so learning either value of leaves the distribution of unchanged.
Product law
Definition Discrete random variables and satisfy the product law when their joint PMF factors at every pair of real numbers and ,
Discrete and are independent if and only if the product law holds. Taking and in the definition of independence gives the product law. Conversely, when the product law holds, the cells with in and in add up to , and their products add up to , so the two are equal. A pair in which or is not a possible value satisfies the law automatically, because both sides are , so for a table it is enough to check every cell against the margins of that same table. A single cell where the law fails proves dependence. A cell where it holds does not by itself settle the other cells, except in a table with two rows and two columns, where the margins then force all four cells to agree. In particular, if and but , the variables are dependent. The joint support of independent variables is therefore the full grid of pairs of possible values, but a full grid does not prove independence.
In plain words In an independent table each cell is its row total times its column total. To test a table, compute its margins, multiply them, and compare the products with every cell.
Example Keep the margins of the device table but change the cells to , and in the first row and , and in the second. The rows still add to and and the columns to , and , so someone who sees only the margins cannot tell this model from the independent one. The top left cell is , while the product law requires , so in the changed model and are dependent. The bottom right cell still equals and all six cells are positive, but neither fact rescues independence. In conditional form, , while .
Joint cumulative distribution function
Definition The joint cumulative distribution function of random variables and on the same probability model is
for all real numbers and . It is defined for variables of every type, discrete or not. For discrete variables it is the sum of over the pairs with and , and both thresholds are included. The marginal CDFs are recovered by letting one threshold grow, since . When has a largest possible value, already for every at least that large.
In plain words Pick a threshold for each variable and ask how likely it is that both variables are at or below their thresholds. When the rows and columns of a table are listed in increasing order, this adds up a block of cells in the top left corner, including any row or column whose value equals a threshold.
Example For the independent device table, , the first two cells of the top row. The value at the thresholds is the same, because has no possible value in and has none in . Also , which equals because every value of is at most , and whenever or .
CDF factorization
Definition Random variables and of any type are independent if their joint CDF factors at every pair of thresholds,
for all real and . This is the general definition of independence for random variables, and for discrete variables it is equivalent to the product law. A failure at one pair of thresholds proves dependence, and agreement at one pair is only one check. When and take finitely many values, both sides stay constant as a threshold moves between consecutive possible values, and both are below the smallest ones, so it is enough to check thresholds at pairs of possible values. Pairs with at least the largest value of , or at least the largest value of , always agree, because there one factor equals and the joint CDF reduces to the other marginal CDF.
In plain words Every threshold block must carry the product of its two marginal CDF values. This version also works for continuous variables, where every single value has probability and there is no PMF to factor.
Example In the independent device table, and . Every other pair of possible values has or , where agreement is automatic, so the CDF factors at all thresholds. In the changed table with the same margins, , so the variables are dependent. Yet there as well, so checking that one threshold alone would have missed the dependence.
Functions of independent variables
Definition Let and be independent discrete random variables, and let and be real functions defined at their possible values. Then and are independent. The reason is that an event is the event for the set of values with , and likewise for , so the product rule for and carries over. The result needs one function of each variable. It does not make independent of , and it does not make independent of , because each of these pairs shares the input . Such pairs have to be checked directly.
In plain words Recoding, rescaling or squaring each output separately keeps independent outputs independent. Building one quantity from both inputs, or two quantities from the same input, can create dependence.
Example In the independent device model, let indicate the event and indicate . These are functions of alone and of alone, so they are independent, and indeed . By contrast, and the total are dependent. The total requires and , so , while differs from .
Mutual independence of random variables
Definition Discrete random variables on the same probability model are mutually independent if
for every choice of real numbers . Summing out any of the variables shows that every subcollection then satisfies the same product law, so this single condition on the full joint PMF covers every group of the variables. Equivalently, for all sets of real numbers. The variables are pairwise independent if every two of them are independent. Mutual independence implies pairwise independence, but for three or more variables pairwise independence does not imply mutual independence. Functions of disjoint groups of mutually independent variables are independent, for example and when , and are mutually independent. A sequence of random variables is IID, independent and identically distributed, if all of them have the same distribution and every finite collection of them is mutually independent.
In plain words Pairwise independence checks the variables two at a time. Mutual independence also requires that learning the values of several of them, whenever those values have positive probability, leaves the probabilities for the rest unchanged. Identical distributions say nothing about dependence on their own. Copying one fair coin toss into ten variables gives ten identically distributed variables that always agree, so they are dependent.
Example Let and be independent fair bits, and let when they differ and when they match. The four triples , , and each have probability , and each variable equals with probability . Any two of the three variables show each of their four possible pairs of values exactly once, with probability , so the three variables are pairwise independent. They are not mutually independent, since
Knowing and together determines . The three variables are identically distributed and pairwise independent, yet they are not IID.
Check yourself
- Let equal or with probability each, and let equal or with probabilities and , independently of . Build the joint table and find .
Show the answer
Each cell is its row probability times its column probability. The row for is and , and the row for is the same, and . The two rows are identical because the two values of are equally likely and, by independence, has the same distribution given either value. The values differ in the cells and , so
- Another pair of binary variables has the joint table with rows , and , . A classmate says the variables are independent, since both margins are and and every cell is positive. Is that right?
Show the answer
No. The margins are indeed and for both variables, so independence would require every cell to equal . The top left cell is , so the product law fails and the variables are dependent. In conditional form, the second variable equals with probability when the first equals , but with probability overall. Equal margins and a full support do not settle independence. Comparing every cell with the product of its row and column totals does.
- Let and be independent, each equal to or with probability , and let . Show that and are independent even though is computed from . Are , and mutually independent?
Show the answer
The four pairs each have probability , and exactly when , so . For and , the event is , with probability , and the other three pairs of values of and likewise each come from exactly one pair and have probability . So the product law holds at all four cells, and and are independent. By symmetry and are independent too, so the three variables are pairwise independent. They are not mutually independent, because while the product of the three probabilities is . The rule about functions does not apply here, since uses both inputs, so the independence of and had to be checked cell by cell.