Almost nothing in economics is about one variable alone. Income goes with schooling, prices with quantities, the return on one asset with the return on another. This lesson is about describing two random variables at once: the table that holds every pair of values, the two single-variable distributions hiding in its edges, what changes when one variable is known, and the single number, covariance, that says whether they move together.
Ashanagar is an invented district. The statistics lessons use it for every worked example, so you meet the same households again as the ideas build: first as a list of numbers, then as a spread, then as a population to sample from.
It has 60 households, each with a monthly income in rupees. Unless a page says otherwise, those 60 are the whole population, and a “sample” means a few of them drawn at random. Where a page needs two variables, it uses a smaller set of 12 households with the head’s years of schooling beside income.
The figures are illustrative, made up once and fixed. They are not official statistics.
Suppose a survey visits a hundred Ashanagar households and records two things for each: the number of earners, X (1 or 2), and the number of children in school, Y (0, 1 or 2). The households sort into six cells. This is invented data, but the shape is the shape of every real survey table.
| Households | Y = 0 | Y = 1 | Y = 2 | Total |
|---|---|---|---|---|
| X = 1 earner | 14 | 22 | 14 | 50 |
| X = 2 earners | 6 | 18 | 26 | 50 |
| Total | 20 | 40 | 40 | 100 |
Divide every count by 100 and the table becomes a joint probability distribution: a household picked at random lands in the cell (X = 2, Y = 2) with probability 0.26. Everything in this lesson is a question you can ask of such a table. How many earners does a typical household have? What share of households send two children to school? Among two-earner households, how many send two? Do earners and schooling move together? We will answer each one, first on this table, then on the tables from past papers.
A discrete joint distribution assigns a probability to every pair of values. Only one rule applies: no probability is negative, and all of them add to 1.
If you only care about X, ignore Y: add each row across all the values of Y. The answer sits in the margin of the table, which is where the word comes from.
In the survey, P(X = 1) = 0.14 + 0.22 + 0.14 = 0.5 and P(Y = 2) = 0.14 + 0.26 = 0.4. The marginals describe each variable on its own, and they throw away how the two are related. Two very different joint tables can have identical margins, so the margins alone never settle questions about dependence.
Now suppose you are told that a household has two earners. You are no longer choosing among all six cells. You are inside the second row, and the probabilities there must be rescaled to add to 1. That rescaling is the conditional distribution.
In the survey, P(Y = 2 | X = 2) = 0.26 ÷ 0.5 = 0.52, while P(Y = 2 | X = 1) = 0.14 ÷ 0.5 = 0.28. Two-earner households are almost twice as likely to have two children in school. The answer to “does Y depend on X?” is already visible: the conditional distribution changes when X changes.
Try it. The lab holds a table whose cells you can edit. Each cell shows the count, the joint probability, and in grey what the cell would hold if X and Y were independent. Click a row to condition on it. Pick the last preset, then edit a single cell and watch what that does to the margins, the covariance and the shading.
Type a count in any cell (0 to 99). The lab divides by the grand total of 10 to get probabilities. Click a row label to condition on that value of X.
| X ↓ Y → | −3 | 2 | 4 | P(X) |
|---|---|---|---|---|
| 0.10.2 | 0.20.15 | 0.20.15 | 0.5 | |
| 0.30.2 | 0.10.15 | 0.10.15 | 0.5 | |
| P(Y) | 0.4 | 0.3 | 0.3 | 1 |
In each cell: the count you typed, then the joint probability, then what independence would require (row total × column total). A cell is shaded when the two differ.
The table of JNU 2021 Q58, in tenths. The covariance is −1.2, the keyed answer. Independence needs every cell to match its product. One shaded cell is enough to break it.
The expected value of any function of the pair is the same sum as always: each value times its probability, now over every cell.
Two special cases come up constantly. With g = x you get E[X], which can be found from the marginal alone. With g = xy you get E[XY], which needs the whole table. In the survey, E[X] = 1.5, E[Y] = 0 × 0.2 + 1 × 0.4 + 2 × 0.4 = 1.2, and E[XY] = 1.9, since the six cells contribute 0, 0.22, 0.28, 0, 0.36 and 1.04.
The conditional distribution has its own mean, the conditional expectation E[Y | X = x]. In the survey it is 1.0 children for one-earner households and 1.4 for two-earner ones. Average those two numbers using the shares of households, 0.5 each, and you recover the overall mean: 0.5 × 1.0 + 0.5 × 1.4 = 1.2. That is not a coincidence.
This is how combined means worked in the first module (the mean of the two groups, weighted by their sizes), now seen from the probability side. It is also the reason a regression of Y on X makes sense: the line is an estimate of the function E[Y | X = x].
Covariance is the average product of the two deviations from their means, and the shortcut that uses E[XY] is the one examiners expect.
For the survey, Cov = 1.9 − 1.5 × 1.2 = 0.1: a small positive number, the sign telling us that households with more earners tend to send more children to school.
Two random variables are independent when knowing one tells you nothing about the other. In a table, that means every cell is the product of its row margin and its column margin.
Independence forces the covariance to zero, since then E[XY] = E[X]E[Y]. The reverse is false, and it is among the most examined facts in this chapter. Let X be −1, 0 or 1 with equal chance and let Y = X². Then Y is completely fixed by X, yet E[XY] = E[X³] = 0 and E[X] = 0, so the covariance is zero. The last preset in the lab is exactly this table. Covariance picks up only straight-line association; Y = X² is a perfect association, but a curved one.
Two quick checks for independence that save time in an exam:
Covariance is what makes variances of sums differ from sums of variances.
For independent variables the last term vanishes. For a portfolio that puts a share w in asset S and 1 − w in asset T, the variance is a quadratic in w, and its minimum has a clean closed form:
With continuous variables the table becomes a surface f(x, y), probabilities become volumes, and every sum becomes an integral. The rules carry over word for word.
The lab shows the density f(x, y) = (2/3)(x + 2y) on the unit square. Slide y. The left panel shows the conditional density of X given that value of y, with its mean marked, and the right panel traces that mean for every y. The other two buttons give a second density and one that factorises, where nothing moves.
Knowing Y reshapes X. At y = 0.5 the conditional mean is 0.5556 (5/9, the keyed answer of GATE 2024 Q48). Because E[X | Y = y] moves with y, X and Y are not independent.
When the region is not a square, the limits of integration carry the work. Three past questions show the pattern:
Definitions and one-step calculations. Most CUET and Hyderabad questions sit here.
Joint tables, standard errors and statement questions, up to JNU and IIT JAM level.
This topic’s hardest questions, from the DSE entrance, are worked through in Lesson 13: Joint distributions.
These are questions from the TestStop bank. A free account answers 10 a day, each with its worked solution; All-Access opens every set with no daily limit.