Random variable and probability mass function
When two coins are tossed, the number of heads is 0, 1 or 2 with different chances. Listing each value with its chance is a probability distribution.
A random variable X assigns a number to each outcome. For a discrete X the probability mass function p(x) = P(X = x) satisfies p(x) ≥ 0 and Σp(x) = 1. The cumulative distribution function F(x) = P(X ≤ x).
Rule 1: Check — All p(x) ≥ 0 and their sum is 1.
Rule 2: Find an unknown — Use Σp(x) = 1 to find the constant.
How is the formula obtained? : Two coins, X = number of heads: P(0) = ¼, P(1) = ½, P(2) = ¼, total 1. F(0) = ¼, F(1) = ¾, F(2) = 1.
- Easy : p(x) = 1/6 for x = 1, …, 6 is a valid distribution (a fair die).
- Medium : P(X = x) = kx for x = 1, 2, 3, 4: k(1 + 2 + 3 + 4) = 1 ⇒ k = 1/10.
- Exam-type : For P(X = 0, 1, 2, 3) = k, 2k, 3k, 4k: 10k = 1 so k = 1/10 and P(X ≤ 1) = 3/10.
Probabilities of all values add to 1.
Using F(x) as p(x).
Make a two-row table: x and p(x). Memory clue : "Table, total one."
P(X < 2) and P(X ≤ 2) differ for discrete X.
CET-style example : If P(X = x) = kx, x = 1, 2, 3, 4, then k = (A) 1/10 (B) 1/4 (C) 1/5 (D) 1/6
Answer : (A). Time-saving method : Sum 1 + 2 + 3 + 4 = 10.
Spot the difference
| Function | Meaning |
|---|---|
| p(x) | P(X = x) |
| F(x) | P(X ≤ x) |
Practice questions
- 1Sum of all p(x) in a distribution?
- 2X = number of heads in two tosses: p(1)?
- 3Same X: F(1)?
- 4Find k if P(X = x) = kx for x = 1, 2, 3, 4.
- 5With that k, P(X ≤ 2)?
- 6P(X = x) = k, 2k, 3k, 4k for x = 0..3: find k.
- 7Is P(X = x) = x/3, x = 1, 2, 3 valid?
- 8Find F(2) for the distribution with k = 1/10 above.
Show answers (try them yourself first)
- 11.
- 21/2.
- 33/4.
- 41/10.
- 53/10.
- 61/10.
- 7Sum = 2 ≠ 1, not valid.
- 80.1 + 0.2 + 0.3 = 3/5.
Expected value, variance and standard deviation
If you play a game many times, the average gain per game is the expected value; the variance tells how much results swing around that average.
Expected value E(X) = Σ x p(x). Variance Var(X) = E(X²) − [E(X)]² where E(X²) = Σ x² p(x). Standard deviation σ = √Var(X).
Rule 1: Mean — E(X) = Σ x·p(x).
Rule 2: Variance — Var(X) = Σ x²p(x) − (Σ x p(x))².
How is the formula obtained? : Distribution 0, 1, 2, 3 with probabilities 0.1, 0.2, 0.3, 0.4: E(X) = 0 + 0.2 + 0.6 + 1.2 = 2; E(X²) = 0 + 0.2 + 1.2 + 3.6 = 5; Var = 5 − 4 = 1; σ = 1.
- Easy : Two coins, X = heads: E(X) = 0·¼ + 1·½ + 2·¼ = 1.
- Medium : Same X: E(X²) = 0 + ½ + 1 = 3/2; Var = 3/2 − 1 = 1/2.
- Exam-type : A fair die: E(X) = 7/2 = 3.5; Var = 35/12 ≈ 2.92.
Variance is never negative.
Subtracting E(X²) − E(X) instead of [E(X)]².
Add columns x·p and x²·p to the table. Memory clue : "Mean of squares minus square of mean."
Do not square the probabilities.
CET-style example : For a fair die E(X) = (A) 3.5 (B) 3 (C) 4 (D) 21
Answer : (A). Time-saving method : Sum of 1..6 is 21; divide by 6.
Spot the difference
| Measure | Formula |
|---|---|
| E(X) | Σ x p(x) |
| Var(X) | Σ x²p(x) − [E(X)]² |
| σ | √Var(X) |
Practice questions
- 1E(X) for two coins, X = heads?
- 2Var(X) for the same X?
- 3E(X) for a fair die?
- 4Var(X) for a fair die?
- 5E(X) when X = 0, 1, 2, 3 with p = 0.1, 0.2, 0.3, 0.4?
- 6Var(X) for the same distribution?
- 7A game pays ₹10 with probability 0.2 and ₹0 otherwise; E(X)?
- 8E(2X + 3) if E(X) = 2?
Show answers (try them yourself first)
- 11.
- 21/2.
- 37/2.
- 435/12 ≈ 2.92.
- 52.
- 61.
- 7₹2.
- 87.
Continuous random variables: probability density function
The waiting time for a bus can take any value in an interval, so we describe its chances with a curve and read probability as area under it.
For a continuous X the probability density function f(x) ≥ 0 has total area ∫f(x) dx = 1; P(a ≤ X ≤ b) = ∫ₐᵇ f(x) dx. E(X) = ∫x f(x) dx and Var(X) = ∫x² f(x) dx − [E(X)]².
Rule 1: Normalise — Total area under f is 1.
Rule 2: Interval probability — P(a ≤ X ≤ b) = ∫ₐᵇ f dx.
How is the formula obtained? : f(x) = 2x on [0, 1]: ∫₀¹ 2x dx = 1 ✓. P(X < ½) = ∫₀^{½} 2x dx = ¼. E(X) = ∫₀¹ 2x² dx = 2/3. E(X²) = ∫₀¹ 2x³ dx = ½, so Var = ½ − 4/9 = 1/18.
- Easy : f(x) = 2x on [0, 1] has total area 1.
- Medium : P(X < ½) = 1/4.
- Exam-type : E(X) = 2/3 and Var(X) = 1/18.
For a continuous variable P(X = a) = 0.
Treating f(x) itself as a probability.
Integrate over the required interval only. Memory clue : "Probability = area."
f(x) can exceed 1; only the area must be 1.
CET-style example : For f(x) = 2x on [0, 1], P(X < ½) = (A) 1/4 (B) 1/2 (C) 1 (D) 1/8
Answer : (A). Time-saving method : ∫₀^{½} 2x dx = x² at ½.
Spot the difference
| Discrete | Continuous |
|---|---|
| p(x) = P(X = x) | f(x) is a density |
| sum | integral |
Practice questions
- 1Is f(x) = 2x on [0, 1] a density?
- 2P(X < ½) for it?
- 3P(X > ½)?
- 4E(X)?
- 5E(X²)?
- 6Var(X)?
- 7Find k if f(x) = kx² on [0, 3] is a density.
- 8For f(x) = 1/2 on [0, 2], find P(X < 1.5).
Show answers (try them yourself first)
- 1Yes, ∫ = 1.
- 21/4.
- 33/4.
- 42/3.
- 51/2.
- 61/18.
- 7k·9 = 1 ⇒ k = 1/9.
- 83/4.