13.3 Random Variables and Probability Distributions
A random variable turns each outcome of an experiment into a number. Its probability distribution lists the values and their probabilities; from it come the mean (expected value) $\mu=\sum x_ip_i$ and the variance $\sigma^2=\sum x_i^2p_i-\mu^2$. The number of successes in repeated independent trials — the binomial distribution, with mean $np$ and variance $npq$ — is the example JEE Main uses most.
A stall at a school fair charges ₹10 a game. You throw two dice: a double six wins ₹100, any other double wins ₹20, and anything else wins nothing. Is it a good game to play? On a single throw anything can happen, but the stall-holder is not interested in one throw — she wants to know what happens over hundreds of games. In $36$ games she can expect, on average, one double six and five other doubles, so she pays out about $100+5\times20=\text{₹}200$ while collecting ₹360. Per game, each player wins back about $\tfrac{200}{36}\approx\text{₹}5.56$ of the ₹10 paid, and the stall gains about ₹4.44. That average is the expected value of the player's winnings.
To make such reasoning precise, we attach a number to every outcome of an experiment — the winnings, the number of heads, the larger of two dice — and call it a random variable. Listing its possible values with their probabilities gives its probability distribution, and the mean and variance of Section 13.1 carry over with probabilities in place of relative frequencies. Insurance premiums, the pricing of lotteries and warranties, quality control and the design of fair games all rest on these two numbers. The most important example is the number of successes in repeated independent trials, whose distribution follows from the multiplication theorem of Section 13.2.
Random Variables and Probability Distributions
A random variable $X$ is a rule that assigns a real number $X(\omega)$ to every outcome $\omega$ of a random experiment — a real function on the sample space. It is discrete if its possible values can be listed $x_1,x_2,\dots$ (finitely or infinitely many). "$X=x_i$" is the event $\{\omega: X(\omega)=x_i\}$.
The probability distribution of a discrete random variable $X$ is the list of its values $x_i$ with the probabilities $p_i=P(X=x_i)$. The numbers must satisfy
$$p_i\ge0\ \text{for every } i\qquad\text{and}\qquad \sum_i p_i=1,$$because the events $X=x_i$ are mutually exclusive and exhaustive. Conversely, any list of values with numbers $p_i$ satisfying both conditions is a valid probability distribution.
For three tosses of a coin, let $X$ be the number of heads. The eight equally likely outcomes give $X=0$ once ($TTT$), $X=1$ three times, $X=2$ three times and $X=3$ once, so the distribution is $P(X=0)=\tfrac18$, $P(X=1)=\tfrac38$, $P(X=2)=\tfrac38$, $P(X=3)=\tfrac18$. Probabilities of ranges of values are sums: $P(X\ge2)=\tfrac38+\tfrac18=\tfrac12$.
| $x$ | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| $P(X=x)$ | $k$ | $4k^2$ | $k$ | $6k^2$ | $k$ |
Which of these tables (values $0, 1, 2$) is a valid probability distribution?
Mean and Variance of a Random Variable
If an experiment is repeated $N$ times and the value $x_i$ turns up $f_i$ times, the mean of the results is $\sum x_i\tfrac{f_i}{N}$ (Definition 13.1). In the long run the relative frequency $\tfrac{f_i}{N}$ settles near $p_i$, so the long-run average is $\sum x_ip_i$. That is the definition.
For a discrete random variable with distribution $P(X=x_i)=p_i$, the mean or expected value and the variance are
$$\mu=E(X)=\sum_i x_ip_i,\qquad\qquad \sigma^2=\operatorname{Var}(X)=\sum_i(x_i-\mu)^2p_i,$$and the standard deviation is $\sigma=\sqrt{\operatorname{Var}(X)}$. More generally $E\big(g(X)\big)=\sum g(x_i)p_i$; for example $E(X^2)=\sum x_i^2p_i$.
- $\operatorname{Var}(X)=E(X^2)-\mu^2$ $=\sum x_i^2p_i-\left(\sum x_ip_i\right)^2$.
- For constants $a$, $b$: $\ E(aX+b)=a\,E(X)+b$ and $\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)$, so $\sigma_{aX+b}=|a|\,\sigma_X$.
- $\operatorname{Var}(X)\ge0$, with equality only when $X$ takes a single value with probability $1$.
Proof. (1) $\sum(x_i-\mu)^2p_i$ $=\sum x_i^2p_i-2\mu\sum x_ip_i+\mu^2\sum p_i$ $=E(X^2)-2\mu^2+\mu^2$, using $\sum x_ip_i=\mu$ and $\sum p_i=1$. (2) $E(aX+b)=\sum(ax_i+b)p_i=a\mu+b$; then $(ax_i+b)-(a\mu+b)=a(x_i-\mu)$, so every squared deviation is multiplied by $a^2$. (3) A sum of non-negative terms is $0$ only if each is $0$. $\blacksquare$ These are exactly Theorems 13.1 and 13.3 of Section 13.1 with $p_i$ in place of $\tfrac{f_i}{N}$ — which is why the mean of a distribution is drawn as its balance point.
For a single throw of a fair die, $\mu=3.5$. What is the variance?
$E(X)=2$ and $E(X^2)=7$. Then $\operatorname{Var}(3X-4)$ is
Repeated Independent Trials: the Binomial Distribution
Many experiments consist of the same trial repeated: a coin tossed $n$ times, $n$ items checked for defects, $n$ guesses on a multiple-choice paper. We count the "successes".
Trials are Bernoulli trials if (i) there are finitely many of them, $n$; (ii) they are independent; (iii) each has exactly two outcomes, success and failure; and (iv) the probability of success, $p$, is the same in every trial. We write $q=1-p$ for the probability of failure.
If $X$ is the number of successes in $n$ Bernoulli trials with success probability $p$, then
$$P(X=r)={}^nC_r\,p^r\,q^{\,n-r},\qquad r=0,1,\dots,n.$$This is the binomial distribution with parameters $n$ and $p$, written $X\sim B(n,p)$.
Proof. A particular sequence with $r$ successes and $n-r$ failures, such as $SS\!F\!S\!F\dots$, has probability $p^rq^{n-r}$ by the multiplication theorem for independent events (Theorem 13.8 and Definition 13.10). The successes can occupy any $r$ of the $n$ places, which can be chosen in ${}^nC_r$ ways (Section 4.2), and different sequences are mutually exclusive; add. $\blacksquare$ The probabilities are the terms of the binomial expansion $(q+p)^n=\sum{}^nC_rq^{n-r}p^r$ (Chapter 5), which is why they add up to $(q+p)^n=1$ — and why the distribution has this name. The NTA list names probability distributions in general; this is the one that appears whenever a JEE Main question repeats an experiment independently.
Proof. Use $r\,{}^nC_r=n\,{}^{n-1}C_{r-1}$ (a committee of $r$ with a chair: choose the chair first). Then
$$\mu=\sum_{r=1}^{n}r\,{}^nC_rp^rq^{n-r}=np\sum_{r=1}^{n}{}^{n-1}C_{r-1}p^{r-1}q^{n-r}=np\,(q+p)^{n-1}=np.$$Applying the same identity twice gives $E\big(X(X-1)\big)=n(n-1)p^2$, so $E(X^2)=n(n-1)p^2+np$ and $\sigma^2=E(X^2)-\mu^2=np-np^2=npq$ by Theorem 13.12. $\blacksquare$ Two consequences used in JEE Main: $\tfrac{\sigma^2}{\mu}=q$, so the variance of a binomial variable is always less than its mean; and for fixed $n$ the variance $np(1-p)$ is largest, $\tfrac n4$, at $p=\tfrac12$.
A fair coin is tossed $10$ times. The single most likely number of heads is $5$. About how likely is exactly $5$ heads?
1. Both conditions on a distribution. When a table contains $k$ and $k^2$, solve $\sum p_i=1$ and then reject any root that makes some $p_i$ negative or greater than $1$.
2. $\operatorname{Var}(X)=E(X^2)-\mu^2$. Not $E(X^2)-\mu$, and not $\left(E(X)\right)^2$. Compute $E(X^2)=\sum x_i^2p_i$ as its own column.
3. Linear changes. $E(aX+b)=aE(X)+b$, but $\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)$: the $b$ disappears and $a$ is squared.
4. Is it really binomial? Only for independent trials with the same $p$ — draws with replacement, repeated throws, independent items. Draws without replacement are not binomial (Example 6(a)); work from the table instead.
5. Recovering $n$ and $p$. $q=\tfrac{\sigma^2}{\mu}$ must lie strictly between $0$ and $1$, and $n=\tfrac{\mu}{p}$ must be a positive integer; if not, no binomial variable has those values.
$X\sim B(n,p)$ has mean $6$ and variance $4$. Then $n$ is
Exercises
Coins and dice are fair unless stated otherwise. Give probabilities as fractions or as decimals to $4$ places.
- 1 Two coins are tossed and $X$ is the number of tails. Write the distribution of $X$.
- 2 A die is thrown twice and $X$ is the number of sixes. Write the distribution of $X$.
- 3 $P(X=x)=kx$ for $x=1,2,3,4$. Find $k$ and $P(X\ge3)$.
- 4 $P(X=x)=\tfrac kx$ for $x=1,2,3,6$. Find $k$ and $P(X\le2)$.
- 5 Is the table "$x$: $0,1,2$; $p$: $0.6, -0.1, 0.5$" a probability distribution? Give a reason.
- 6 Two balls are drawn without replacement from a bag with $4$ red and $2$ white balls; $X$ is the number of white balls drawn. Find the distribution of $X$.
- 7 Two dice are thrown and $X$ is the smaller of the two numbers. Show that $P(X=r)=\tfrac{13-2r}{36}$ and find $P(X=1)$.
- 8 $P(X=k)=c\left(\tfrac13\right)^k$ for $k=1,2,3,\dots$. Find $c$.
- 1 Find the mean and variance of the number shown by a fair die.
- 2 Find the mean and variance of $X$ in Exercise I.6.
- 3 $E(X)=2$ and $\operatorname{Var}(X)=3$. Find $E(3X-1)$, $\operatorname{Var}(3X-1)$ and $E(X^2)$.
- 4 $X$ takes the values $-1, 0, 2$ with probabilities $0.3, 0.5, 0.2$. Find its mean and variance.
- 5 Find the mean and variance of $X$ in Exercise I.3.
- 6 A card is drawn. An ace wins ₹50, a face card wins ₹20, and any other card loses ₹5. Find the expected gain.
- 7 $X$ takes the values $1, 2, 3$, has mean $2.3$, and $P(X=1)=0.2$. Find $P(X=2)$, $P(X=3)$ and $\operatorname{Var}(X)$.
- 8 Modelling. An insurer charges ₹2000 a year for a policy. With probability $0.02$ it pays a claim of ₹50 000, with probability $0.05$ a claim of ₹10 000, and otherwise nothing. Find the insurer's expected profit per policy.
- 1 A coin is tossed $6$ times. Find the probability of exactly $4$ heads.
- 2 In part 1, find the probability of at least $5$ heads.
- 3 A die is thrown $4$ times. Find the probability of at least one six.
- 4 $10\%$ of the bulbs from a factory are defective. Five are chosen at random (independently). Find the probability that none is defective, and that at most one is.
- 5 A die is thrown $30$ times. Find the mean and variance of the number of sixes.
- 6 A binomial variable has mean $6$ and variance $4$. Find $n$ and $p$.
- 7 Can a binomial variable have mean $5$ and variance $6$? Explain.
- 8 A student guesses all $5$ questions of a test, each with $4$ options. Find the probability of at least $4$ correct answers.
- 9 Find the least $n$ for which the probability of at least one six in $n$ throws of a die exceeds $0.9$.
- 1 $P(X=k)=\left(\tfrac12\right)^k$ for $k=1,2,3,\dots$. Find $E(X)$.
- 2 A bag has $3$ red and $2$ black balls. Balls are drawn one at a time without replacement until a red ball appears; $X$ is the number of draws. Find the distribution, mean and variance of $X$.
- 3 A coin is tossed $4$ times; $X$ is the number of heads and $Y=2X-3$. Find $E(Y)$ and $\operatorname{Var}(Y)$.
- 4 For $X\sim B(20,p)$, find the largest possible variance and the value of $p$ that gives it.
- 5 $X$ takes the values $0,1,2,3$ with $P(X=0)=P(X=3)=a$ and $P(X=1)=P(X=2)=b$. If $\operatorname{Var}(X)=1.05$, find $a$ and $b$.
E1. JEE Main · MCQ A random variable $X$ takes the values $1,2,3,4$ with $P(X=x)=kx^2$. Then $E(X)$ equals (A) $\tfrac{10}{3}$ (B) $3$ (C) $\tfrac52$ (D) $\tfrac72$
E2. JEE Main · Numerical Two different numbers are chosen at random from $\{1,2,3,4,5\}$ and $X$ is the larger of them. Find $\operatorname{Var}(3X+2)$. Give the answer to the nearest integer.
E3. JEE Main · MCQ The mean and variance of a binomial random variable $X$ are $4$ and $\tfrac83$. Then $P(X=1)$ is (A) $\dfrac{2^{11}}{3^{12}}$ (B) $\dfrac{2^{13}}{3^{11}}$ (C) $\dfrac{2^{12}}{3^{11}}$ (D) $\dfrac{2^{11}}{3^{11}}$
E4. JEE Main · Numerical To play a game a player pays ₹$a$ and tosses two fair coins. Two heads win ₹60, exactly one head wins ₹10, and no head wins nothing. Find $a$ if the game is fair (the player's expected net gain is zero). Give the answer to the nearest integer.
E5. JEE Main · MCQ For a random variable $X$, $E(X)=3$ and $E(X^2)=13$. Then $\operatorname{Var}(2X-5)$ is (A) $21$ (B) $26$ (C) $52$ (D) $16$
E6. JEE Main · Numerical A fair coin is tossed until a head appears or until it has been tossed $4$ times, whichever comes first. If $X$ is the number of tosses, find $8\,E(X)$. Give the answer to the nearest integer.
Research question. How should an airline decide how many tickets to sell for a flight, given that some passengers with tickets do not turn up?
Why it matters. Airlines, railways, hotels and hospital clinics all "overbook": they accept more bookings than they have places because a predictable fraction of customers do not show up. Too little overbooking leaves seats empty; too much means turning away passengers who must then be compensated. The number of passengers who turn up is, to a good approximation, a binomial random variable, and the decision is an expected-value calculation.
What to do.
- Model a $100$-seat aircraft. Assume each ticket-holder turns up independently with probability $p=0.92$. If $n$ tickets are sold, the number who turn up is $X\sim B(n,0.92)$.
- For $n=100,102,104,106,108$ compute $E(X)$, $\sigma$ and $P(X\gt100)$ (use a spreadsheet's binomial function, or sum the terms of Theorem 13.13).
- Suppose each ticket earns ₹6000 and each passenger turned away costs ₹20 000 in compensation. Write the expected profit as a function of $n$ and find the best $n$.
- Repeat with $p=0.85$ and $p=0.97$. How sensitive is the best $n$ to the show-up probability?
Tools: A spreadsheet or a short Python script; Interactive 2 for intuition about how the distribution's spread grows with $n$.
Hand in: A table of $n$, $P(X\gt100)$ and expected profit, your recommended $n$, and two sentences on whether the independence assumption is realistic (families and groups travel together).
Going further. If groups of $4$ always show up or fail to show up together, the variance of the number who turn up increases. Explain why, and how that should change the airline's decision.
🧪 Self-check quiz
Q1. $P(X=x)=k(x+1)$ for $x=0,1,2,3$ defines a probability distribution when $k$ equals
Q2. The expected value of the number shown by a fair die is
Q3. $E(X)=2$ and $E(X^2)=5$. The standard deviation of $X$ is
Q4. A coin with $P(\text{head})=0.3$ is tossed $10$ times. The mean and variance of the number of heads are
Q5. $X$ takes the values $0,1,2$ with $P(X=0)=P(X=2)=p$ and $P(X=1)=1-2p$, where $0\lt p\lt\tfrac12$. Then $E(X)$ is