📘 Lesson 5 of 8 · Probability

🎰 Random Variables

A random variable assigns a number to every outcome of a random experiment, turning abstract outcomes into something we can calculate with.

Course progress: 62%

01 Key Concepts

Random Variable (X)

A rule that assigns a numeric value to each outcome in a sample space, such as X = number of heads in 3 coin flips.

Discrete Random Variables

Take on a countable set of values, often whole numbers (number of defective items, number of customers).

Continuous Random Variables

Can take any value within a range, often from measurements (height, weight, time).

Probability Distribution

A table, formula, or graph showing every possible value of X and its associated probability.

Expected Value (Mean)

E(X) = sum of [x * P(x)] over all possible values — the long-run average value of X.

Variance and Standard Deviation

Variance measures how spread out the values of X are; standard deviation is the square root of variance, in the same units as X.

02 Key Formulas

03 Solved Examples

Example 1 A coin is flipped twice. Let X = number of heads. Find the probability distribution of X.
  1. Possible outcomes: HH, HT, TH, TT, each with probability 1/4.
  2. X=0 (TT): P=1/4. X=1 (HT or TH): P=2/4. X=2 (HH): P=1/4.
Answer: P(X=0)=1/4, P(X=1)=1/2, P(X=2)=1/4
Example 2 Using the distribution above, find E(X).
  1. E(X) = 0*(1/4) + 1*(1/2) + 2*(1/4) = 0 + 0.5 + 0.5.
Answer: E(X) = 1
Example 3 A random variable X takes values 1, 2, 3 with probabilities 0.2, 0.5, 0.3. Find E(X).
  1. E(X) = 1*(0.2) + 2*(0.5) + 3*(0.3) = 0.2 + 1.0 + 0.9.
Answer: E(X) = 2.1

04 Practice Questions

1Is 'number of cars passing an intersection in an hour' discrete or continuous?
Discrete
2Is 'exact weight of a bag of rice' discrete or continuous?
Continuous
3X takes values 0,1 with P(0)=0.3, P(1)=0.7. Find E(X).
0.7
4A die is rolled; let X be the outcome. Find E(X).
3.5
5What does E(X) represent in plain terms?
The long-run average value of X over many repetitions

📄 Random Variables — Downloadable Worksheet

10 questions with a full answer key. Grab the PDF to print, or try the interactive version in your browser.