Learn
Interactive·

Random Variables & Probability Distributions

Once outcomes are assigned numbers, probability becomes something we can calculate and summarize.

Two coin tosses can produce HH, HT, TH, or TT. But the question may be simply: how many heads appeared?

A random variable is a rule that assigns a number to each outcome. HH receives 2, HT and TH receive 1, and TT receives 0.

Key question

Which number should be attached to each outcome, and how should the probabilities of those numbers be represented?

1

Concept

What is a random variable?

A random variable maps outcomes to numbers

Coin outcomeRandom variable X: number of heads
HH2
HT1
TH1
TT0

The variable is not the outcome itself. Different outcomes may map to the same numerical value.

2

Why It Matters

How do discrete and continuous variables differ?

The distinction depends on whether values are countable

Discrete random variable

Takes countable values

defect count · visits · successes

Continuous random variable

Can take any value in an interval

time · length · temperature · weight

Why the distinction matters

For a discrete variable, individual values can carry probability. For a continuous variable, probability is assigned to intervals.

3

How It Works

What does a probability distribution show?

A probability distribution pairs values with probabilities

XP(X=x)
00.25
10.50
20.25

Every probability in a discrete distribution is nonnegative, and the probabilities sum to 1.

What a distribution tells us

It shows which values are possible, which values are common, and how the total probability is allocated.

4

Example

The same experiment can define different variables

The same experiment can support different random variables

Two dice

X = the sum of the two dice

Y = the larger of the two values

Z = the number of even dice

The sample space is unchanged, but the distribution and interpretation depend on the numerical rule chosen.

5

Interactive

Change the distribution of heads

Change the distribution of heads

Change the probability of heads and watch the distribution of X, the number of heads in two tosses.

X = 0

0.250

X = 1

0.500

X = 2

0.250

The random variable X does not describe the exact coin sequence. It records only the number of heads.

Key lesson

A random variable turns a complex outcome into one numerical quantity that can be analysed.

Key takeaways

  • A random variable assigns a number to each outcome.
  • Discrete random variables take countable values.
  • Continuous random variables take values across intervals.
  • A probability distribution lists possible values and their probabilities.
  • Discrete probabilities sum to 1.
  • Different questions can define different random variables on the same sample space.

Go Deeper

Expected Value & Variance