13.4 Random Variables and Probability Distributions
A random variable attaches a number to every outcome of an experiment — the number of heads, a sum, a prize. Listing its values with their probabilities gives its probability distribution, and the weighted average $E(X)=\sum x_ip_i$ is its mean: the long-run average value and the balance point of the distribution.
At a school fete, a stall charges $\text{₹}\,20$ for one throw of two dice. A double six wins $\text{₹}\,200$, any other double wins $\text{₹}\,50$, and everything else wins nothing. Is it a good deal for the player? For the stall? Asking "what are the chances?" is not enough here, because the outcomes carry different amounts of money. What we need is to turn each outcome into a number — the player's gain — and then find what that number is worth on average over many games.
A rule that turns outcomes into numbers is a random variable. The table of its possible values and their probabilities is its probability distribution, and the probability-weighted average of the values is its mean or expectation $E(X)$. Insurers use expectations to set premiums, lotteries to fix prizes, engineers to plan for average loads, and you will use them to decide whether a game is fair. (At the end of this section you will find that the fete game costs the player $\text{₹}\,7.50$ per throw on average.)
Random Variables
Toss two coins. The sample space is $S=\{HH,HT,TH,TT\}$. If we only care about how many heads appear, we attach the number $2$ to $HH$, $1$ to $HT$ and to $TH$, and $0$ to $TT$. That attachment is a function from $S$ to the real numbers.
So a random variable is neither random nor a variable in the usual sense: it is a fixed rule. The randomness is in which outcome happens. Several random variables can be defined on the same sample space: for two dice, the sum, the larger number, the number of sixes and the player's gain at the fete stall are four different random variables on the same $36$ outcomes. All the random variables in this course take finitely many values.
Probability Distributions
For each value $x_i$ of $X$, the events $X=x_i$ are mutually exclusive (an outcome gives only one value) and together they cover $S$. So their probabilities are non-negative and add up to $1$ — and conversely any such list describes a random variable completely.
| $X$ | $x_1$ | $x_2$ | $\cdots$ | $x_n$ |
|---|---|---|---|---|
| $P(X)$ | $p_1$ | $p_2$ | $\cdots$ | $p_n$ |
To find a probability distribution: (1) list the values of $X$; (2) for each value, find the outcomes that give it and add their probabilities; (3) check that the total is $1$.
| $X$ | $0$ | $1$ | $2$ | $3$ |
|---|---|---|---|---|
| $P(X)$ | $\tfrac18$ | $\tfrac38$ | $\tfrac38$ | $\tfrac18$ |
| $X$ | $1$ | $2$ | $3$ | $4$ | $5$ |
|---|---|---|---|---|---|
| $P(X)$ | $k$ | $2k$ | $6k$ | $4k^2$ | $6k^2$ |
| $X$ | $0$ | $1$ | $2$ |
|---|---|---|---|
| $P(X)$ | $\tfrac{1128}{1326}=\tfrac{188}{221}$ | $\tfrac{192}{1326}=\tfrac{32}{221}$ | $\tfrac{6}{1326}=\tfrac1{221}$ |
The Mean (Expectation) of a Random Variable
Throw a fair die many times. Each face turns up about $\tfrac16$ of the time, so in $600$ throws the total is about $100(1)+100(2)+\cdots+100(6)=2100$, an average of $3.5$ per throw. The average is $1\cdot\tfrac16+2\cdot\tfrac16+\cdots+6\cdot\tfrac16=3.5$: each value is weighted by its probability. Notice that $3.5$ is not a value the die can show — the mean is a long-run average, not a "most likely" result.
Two pictures help. Long-run average: if the experiment is repeated $N$ times, the value $x_i$ turns up about $Np_i$ times, so the average of all the values observed is close to $\tfrac{1}{N}\sum x_i(Np_i)=\sum x_ip_i$ (Interactive 2 shows this happening). Balance point: $\sum(x_i-\mu)p_i=\sum x_ip_i-\mu\sum p_i=\mu-\mu=0$, so weights $p_i$ placed at the points $x_i$ of a beam balance on a pivot at $\mu$ (Interactive 1).
(a) $x_1\le E(X)\le x_n$: the mean lies between the smallest and the largest value.
(b) For constants $a$ and $b$, the random variable $aX+b$ (which takes the value $ax_i+b$ whenever $X=x_i$) has mean $E(aX+b)=a\,E(X)+b$.
Proof. (a) Each $x_i\ge x_1$, so $\sum x_ip_i\ge\sum x_1p_i=x_1$; similarly $\sum x_ip_i\le x_n$. (b) $E(aX+b)=\sum(ax_i+b)p_i$ $=a\sum x_ip_i+b\sum p_i$ $=a\,E(X)+b$. $\square$
Part (b) is how money problems are simplified: if a game pays a prize $X$ and costs $\text{₹}\,20$ to play, the player's expected gain is $E(X-20)=E(X)-20$.
| $Y$ | $1$ | $2$ | $3$ | $4$ | $5$ | $6$ |
|---|---|---|---|---|---|---|
| $P(Y)$ | $\tfrac1{36}$ | $\tfrac3{36}$ | $\tfrac5{36}$ | $\tfrac7{36}$ | $\tfrac9{36}$ | $\tfrac{11}{36}$ |
1. Forgetting to check $\sum p_i=1$. It is the quickest way to catch a missing value or a counting error, and it is how unknown constants are found.
2. Accepting a negative root. When $k$ comes from a quadratic, reject any value that makes a probability negative or greater than $1$.
3. Averaging the values instead of weighting them. $E(X)$ is $\sum x_ip_i$, not $\tfrac{x_1+\cdots+x_n}{n}$ — those agree only when all the $p_i$ are equal.
4. Expecting to see the mean. $E(X)$ need not be a possible value (a die has mean $3.5$); it is a long-run average.
5. Mixing up prize and gain. Subtract the cost of playing: expected gain $=E(\text{prize})-\text{fee}$.
In JEE Advanced 2026 (mean and variance of a random variable) and JEE Main 2026 (probability distribution of a random variable); not in the CBSE Class 12 syllabus. The mean tells you where a distribution is centred, but not how spread out it is. The variance of a random variable $X$ with mean $\mu$ is the expected squared distance from the mean, and the standard deviation is its square root:
$$\operatorname{Var}(X)=\sigma^2=\sum_{i=1}^{n}(x_i-\mu)^2p_i,\qquad \sigma=\sqrt{\operatorname{Var}(X)}.$$Expanding the square gives the working formula $\operatorname{Var}(X)=E(X^2)-[E(X)]^2$, where $E(X^2)=\sum x_i^2p_i$.
Worked example. Find the variance and standard deviation of the score $X$ on one throw of a fair die. Solution. $\mu=\tfrac72$ and $E(X^2)=\tfrac{1+4+9+16+25+36}{6}=\tfrac{91}{6}$, so $\operatorname{Var}(X)=\tfrac{91}6-\tfrac{49}4=\tfrac{182-147}{12}=\tfrac{35}{12}$ and $\sigma=\sqrt{35/12}\approx1.71$. Check with the definition: $\tfrac16\left[(\tfrac52)^2+(\tfrac32)^2+(\tfrac12)^2\right]\times2=\tfrac13\cdot\tfrac{25+9+1}{4}=\tfrac{35}{12}$ ✓.
Exercises
- 1 State the possible values of: (a) the number of tails in $4$ tosses of a coin; (b) the number of red balls among $3$ balls drawn without replacement from a bag of $4$ red and $2$ black balls; (c) the absolute difference of the numbers on two dice.
- 2 Which of these can be the probabilities of a random variable with three or four values? (a) $0.3,\ 0.4,\ 0.3$; (b) $0.5,\ 0.6,\ -0.1$; (c) $\tfrac12,\ \tfrac13,\ \tfrac14$; (d) $0.2,\ 0.2,\ 0.2,\ 0.4$.
- 3 Find the probability distribution of the number of tails in two tosses of a coin.
- 4 Two dice are thrown. Find the probability distribution of the absolute difference $D$ of the two numbers.
- 5 A die is thrown twice. Find the probability distribution of the number of sixes.
- 6 $P(X=x)=kx$ for $x=1,2,3,4$ (and $0$ otherwise). Find $k$ and $P(X\le2)$.
- 7 $P(X=x)=\dfrac kx$ for $x=1,2,3,6$. Find $k$ and $P(X\gt1)$.
- 8 Two cards are drawn without replacement. Find the probability distribution of the number of hearts.
- 9 Three balls are drawn without replacement from a bag of $4$ red and $2$ black balls. Find the probability distribution of the number of black balls.
- 1 Find the mean number of tails in two tosses of a coin (Exercise I.3).
- 2 Find $E(D)$ for the absolute difference of Exercise I.4.
- 3 Find the mean number of sixes in two throws of a die (Exercise I.5).
- 4 Find $E(X)$ for the distribution of Exercise I.6.
- 5 Find the mean number of hearts in Exercise I.8.
- 6 Find the mean number of black balls in Exercise I.9.
- 7 $X$ takes the values $-2,-1,0,1,2$ with probabilities $0.1,0.2,0.3,0.3,0.1$. Find $E(X)$.
- 8 Two dice are thrown and $Z$ is the smaller of the two numbers. Find the distribution and the mean of $Z$, and check that $E(Y)+E(Z)=7$, where $Y$ is the larger number (Example 5). Why must this be so?
- 9 If $E(X)=2.5$, find $E(2X-3)$ and $E(5-X)$.
- 1 A charity sells $1000$ raffle tickets at $\text{₹}\,10$ each. There is one prize of $\text{₹}\,2000$, five of $\text{₹}\,500$ and twenty of $\text{₹}\,50$. Find the expected prize for one ticket and the buyer's expected gain.
- 2 An insurer charges a premium of $\text{₹}\,1500$ a year for a policy that pays $\text{₹}\,50\,000$ if a claim is made; the probability of a claim in a year is $0.02$. Find the insurer's expected profit per policy per year.
- 3 A game costs $\text{₹}\,30$. A die is thrown and the player receives $\text{₹}\,10$ times the number shown. Find the player's expected gain, and the fee that would make the game fair.
- 4 In a test, a correct answer earns $4$ marks and a wrong one loses $1$ mark. Each question has $4$ options. Find the expected score from guessing one question at random, and from guessing $5$ questions.
- 5 A coin is tossed until a head appears or until it has been tossed $3$ times. Find the distribution and the mean of the number of tosses $X$.
- 6 A box of $5$ bulbs contains $2$ defective ones. Bulbs are tested one by one, in random order, until both defective bulbs have been found. Find the distribution and the mean of the number of tests $X$.
- 1 Show that $E(X-\mu)=0$, where $\mu=E(X)$.
- 2 A random variable takes only the values $1$ and $3$, and $E(X)=2.2$. Find its distribution.
- 3 $X$ takes each of the values $1,2,\dots,n$ with probability $\tfrac1n$. Show that $E(X)=\tfrac{n+1}{2}$.
How this is examined: Board papers ask you to find an unknown constant in a distribution, to write down a distribution by counting (cards, balls, dice) and to find its mean, often as a 3-mark question or a case study. JEE Main asks for means — and, from the 🚀 box, variances — of distributions built from multi-stage experiments.
E1. Board · 1 mark A random variable $X$ takes the values $0$, $1$, $2$ with probabilities $\tfrac14$, $k$, $\tfrac14$. Then $E(X)$ is (A) $1$ (B) $\tfrac12$ (C) $\tfrac34$ (D) $2$
E2. Board · 1 mark Assertion–Reason. Assertion (A): $P(X=x)=\tfrac x6$ for $x=1,2,3$ defines a probability distribution. Reason (R): a list of numbers is the probability distribution of a random variable if they are all positive and add up to $1$. (A) Both A and R are true and R is the correct explanation of A (B) Both A and R are true but R is not the correct explanation of A (C) A is true but R is false (D) A is false but R is true
E3. Board · 3 marks Two cards are drawn one after the other with replacement from a well-shuffled pack of $52$. Find the probability distribution of the number of kings, and its mean.
E4. Board · Case study A food-delivery kitchen records the number $X$ of orders it receives in a randomly chosen minute during lunch hours (illustrative data): $P(X=0)=0.1$, $P(X=1)=k$, $P(X=2)=0.3$, $P(X=3)=2k$, $P(X=4)=0.15$, and $X$ takes no other values. (i) Find $k$. (1 mark) (ii) Find $P(X\ge2)$. (1 mark) (iii) Find the expected number of orders per minute, and the expected number in a $60$-minute lunch hour. (2 marks)
E5. JEE Main A box contains $3$ white and $2$ black balls. Balls are drawn one at a time without replacement until the first black ball appears. The expected number of draws is (A) $2$ (B) $\tfrac52$ (C) $\tfrac32$ (D) $\tfrac95$
E6. JEE Main (Numerical value; uses the 🚀 box.) $X$ takes the values $1$, $2$, $3$ with probabilities $0.2$, $0.5$, $0.3$. If $\sigma$ is its standard deviation, find $10\sigma$.
Research question. How many cards does it take to complete a collection? A snack brand puts one of $6$ different cards in each packet, all equally likely. On average, how many packets must you buy to collect all $6$ — and how close does a class experiment come to the theory?
Why it matters. This "coupon collector" problem appears whenever something must be covered completely: testing every feature of an app, sampling every species in an ecology survey, a network sending every piece of a file. Its answer is an expectation, and it is surprisingly larger than people guess.
What to do.
- Simulate: throw a die until all six faces have appeared and record the number of throws $T$. Each student does this $5$ times; pool the class results.
- Draw a bar chart of the relative frequencies of $T$ and compute the average of all the values.
- Theory: once you already have $j$ different faces, each new throw gives a new face with probability $\tfrac{6-j}{6}$. The number of throws needed for that step has mean $\tfrac{6}{6-j}$ (you may take this from the formula $\sum_{k\ge1}k\,q^{k-1}p=\tfrac1p$ for a waiting time with success probability $p$). Add up the means of the six steps.
- Compare the class average with the theoretical value. Is it closer for the pooled data than for one student's five trials?
- Extend the spreadsheet formula to $n$ different cards. How does the expected number of packets grow with $n$?
Tools: Dice (or a random-number app); a spreadsheet for the frequency table and the sums.
Hand in: The pooled frequency table and chart, your theoretical calculation, and a paragraph on why the long-run average approaches the expectation.
Going further. If the cards are not equally likely — say one card is rare — how does the expected number change? Try it in a simulation.
🧪 Self-check quiz
Q1. Which list can be the probabilities of a random variable with three values?
Q2. The mean score on one throw of a fair die is
Q3. $X$ takes the values $0$, $1$, $2$ with probabilities $0.3$, $0.4$, $0.3$. Then $E(X)$ is
Q4. A random variable is
Q5. A game costs $\text{₹}\,3$ to play and pays $\text{₹}\,10$ with probability $0.2$, otherwise nothing. The player's expected gain per game is