← 📊 Random Variables, Expectation & Variance
Subtopic 1 of 6

3.1Random variables: PMF, PDF and CDF

The idea

A random variable turns outcomes into numbers. Its PMF (or density) says how likely each value is, and its CDF F(x) = P(X ≤ x) adds the probability up to x.

Think of it like this: A game that pays Rs 10 for heads and Rs 0 for tails: the payout is a random variable, with a table of values and chances.

Why it exists

Everything else (mean, variance, distributions) is computed from this table or curve.

How it works

  1. Discrete: list each value x with its probability p(x); all p(x) ≥ 0 and they add to 1.
  2. Continuous: a density f(x) ≥ 0 with area 1; P(a ≤ X ≤ b) is the area from a to b.
  3. CDF: F(x) = P(X ≤ x). It never decreases and runs from 0 to 1.
  4. For a discrete X the CDF includes the mass at x, so it jumps up at each possible value.
  5. P(a < X ≤ b) = F(b) − F(a).

Worked example: GATE 2012: X = +1 or −1 with probability 0.5 each

F(−1) = P(X ≤ −1) = 0.5, because the point −1 itself counts. F(1) = 1. In between, F(0) = 0.5: a step function. Load the preset and move the slider t across −1 and +1.

Now play with it

  • →Use the sum-of-two-dice preset and read F(7).
  • →Edit the table so the probabilities add to 1.2 and see the error message.
0.5
-1
0.5
1
E[X] = Σ x·p0
E[X²]1
Var(X) = E[X²] − E[X]²1
standard deviation1
E[X²]1
F(2) = P(X ≤ 2)1

E[g(X)] = Σ g(x)·p(x): apply g to the values, not to the mean. Note E[X²] ≠ E[X]² in general; the gap is the variance. The CDF F(t) = P(X ≤ t) is a step function that climbs from 0 to 1 (GATE 2012: F(−1) = 0.5 and F(1) = 1).

Discrete XContinuous X
Describes the variablePMF p(x) = P(X = x)density f(x), P(X = x) = 0
Total probabilityΣ p(x) = 1∫ f(x) dx = 1
P(a ≤ X ≤ b)sum of p over the valuesarea ∫ₐᵇ f(x) dx
CDF F(x) = P(X ≤ x)step function (includes the point)smooth, F'(x) = f(x)
Mean E[X]Σ x p(x)∫ x f(x) dx

The CDF always runs from 0 up to 1 and never decreases, for both kinds of variable.

Check yourself

X is +1 or −1 with probability 1/2 each. What is F(0) = P(X ≤ 0)?

Remember: PMF values add to 1; F(x) = P(X ≤ x) is a non-decreasing step function that includes the mass at x.
Exam notes (the dense version)

A random variable X assigns a number to each outcome. Discrete: the PMF p(x) = P(X = x) with Σ p(x) = 1. Continuous: a density f(x) ≥ 0 with ∫ f = 1 and P(a ≤ X ≤ b) = ∫ₐᵇ f(x) dx (single points have probability 0). The CDF F(x) = P(X ≤ x) rises from 0 to 1; for a discrete X it includes the mass at x itself.

Previous year questions: Random Variables, Expectation & Variance (11)

PYQs are grouped by topic, so this is the full set for Random Variables, Expectation & Variance; try the ones that match this subtopic. Open all 11 on the topic page.