📘 CodingMarble Learn

Probability Distributions of Discrete Random Variables

A random variable X turns each outcome of an experiment into a number. Its probability distribution lists every value x with its probability P(X = x); each P is between 0 and 1 and they add to 1. The mean E(X) = Σx·P(x) is the long-run average (balance point). The variance Var(X) = Σ(x − μ)²P(x) = E(X²) − μ² measures spread; σ = √Var. Special models: uniform, binomial B(n, p) with mean np and variance np(1 − p), and Poisson with mean = variance = λ.

🎬 Step-by-step story

  1. Toss two coins. X = number of heads. Each outcome gets a number: 0, 1 or 2. That rule is a random variable.
  2. Count how often each number comes. The bars show P(X = 0), P(1), P(2). All bars together add to 1. This is a probability distribution.
  3. The mean E(X) is the balance point of the bars. Multiply each value by its probability and add.
  4. Two charts can have the same mean but different spread. Variance and standard deviation measure the spread.
  5. Binomial: n tries, each success with chance p. Move the sliders. The hill moves to np.
  6. Free play: switch between binomial, Poisson and a fair die. Watch the mean and variance change.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Is a random variable really a variable?

Not quite. It is a rule (a function) that turns each outcome into a number. Step 1 shows each coin pair pointing to one number.

Why must the probabilities add to exactly 1?

Something must happen, and the values do not overlap. So all the bars together cover every outcome once. Step 2 shows the total.

How can the mean be a value X never takes?

The mean is a balance point, like the centre of a see-saw. It can sit between bars. Step 3 shows the wedge.

Two distributions have the same mean. Are they the same?

No. Their spread can be very different. Step 4 shows two charts with mean 2 but variances 0.2 and 2.2.

Why does the binomial hill peak near np?

The mean of B(n, p) is np, and for moderate p the tallest bars sit around it. Move p in step 5 and watch.

When do I use Poisson instead of binomial?

When you count events in time or space with no fixed number of trials, or when n is large and p is small (λ = np). Compare them in step 6.

Random variables: turning outcomes into numbers

A random variable is a rule that gives a number to every outcome of a random experiment. We write it with a capital letter, like X.

Example: toss two coins. X = number of heads. HH → 2, HT → 1, TH → 1, TT → 0.

The probability distribution table

The probability distribution of X lists each value x with its probability P(X = x). For two coins:

x012
P(X = x)1/41/21/4

Two rules must always hold:

  1. 0 ≤ P(X = x) ≤ 1 for every x.
  2. ΣP(X = x) = 1.

We can show it as a table, a formula or a bar chart. The cumulative distribution F(x) = P(X ≤ x) adds the bars from the left.

Expected value, variance and standard deviation

Expected value (mean): μ = E(X) = Σ x·P(X = x). It is the long-run average if you repeat the experiment many times, and the balance point of the bar chart.

Variance: Var(X) = Σ (x − μ)²·P(X = x) = E(X²) − [E(X)]², where E(X²) = Σ x²·P(X = x).

Standard deviation: σ = √Var(X). It has the same unit as X.

Useful rules: E(aX + b) = aE(X) + b and Var(aX + b) = a²Var(X).

Fair game: a game is fair when the expected gain is 0.

Special distributions: uniform, binomial, Poisson

Discrete uniform

Every value is equally likely. A fair die: P(X = k) = 1/6 for k = 1 to 6, mean 3.5.

Binomial B(n, p)

Use it when: a fixed number n of trials, each trial has two results (success / failure), the chance of success p is the same each time, and trials are independent (Bernoulli trials).

P(X = k) = ⁿCₖ pᵏ (1 − p)ⁿ⁻ᵏ, k = 0, 1, …, n. Mean = np, variance = np(1 − p).

Poisson Po(λ)

Counts random events in a fixed time or space when they happen independently at an average rate λ (calls per hour, typing errors per page). P(X = k) = e^(−λ) λᵏ / k!, k = 0, 1, 2, … Mean = variance = λ. It approximates B(n, p) when n is large and p is small, with λ = np.

Continuous distributions and waiting times

For a continuous X we use a probability density curve f(x). Probability = area under the curve, so P(X = one exact value) = 0 and the total area is 1.

Try it

Roll a die 30 times and tally the faces. Draw the bar chart. Is it flat like the uniform bars in step 6? Then work out the average of your 30 rolls. Is it near 3.5? Repeat with 60 rolls: it gets closer. That is expected value in action.

Key formulas and definitions

Worked examples

1. X is the number shown on a fair die. Find E(X).

Each value 1–6 has P = 1/6. E(X) = (1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 3.5.

2. P(X = 0) = 0.2, P(X = 1) = k, P(X = 2) = 0.5. Find k.

Probabilities add to 1: 0.2 + k + 0.5 = 1, so k = 0.3.

3. X takes 0, 1, 2, 3 with probabilities 0.1, 0.2, 0.3, 0.4. Find E(X) and Var(X).

E(X) = 0 + 0.2 + 0.6 + 1.2 = 2.0. E(X²) = 0 + 0.2 + 1.2 + 3.6 = 5.0. Var(X) = 5.0 − 2.0² = 1.0, so σ = 1.

4. A game: pay ₹10, roll a die; get ₹30 for a six, nothing otherwise. Is it fair?

Gain = 20 with P = 1/6, −10 with P = 5/6. E(gain) = 20/6 − 50/6 = −30/6 = −5. You lose ₹5 per game on average, so it is not fair.

5. A coin is tossed 5 times. Find P(exactly 3 heads).

B(5, 0.5). P(X = 3) = ⁵C₃ (0.5)³(0.5)² = 10 × 1/32 = 10/32 = 0.3125.

6. 10% of bulbs are faulty. In a pack of 8, find the mean and variance of the number of faulty bulbs, and P(none faulty).

B(8, 0.1). Mean = 8 × 0.1 = 0.8. Variance = 8 × 0.1 × 0.9 = 0.72. P(X = 0) = 0.9⁸ ≈ 0.430.

7. A help desk gets on average 3 calls per minute (Poisson). Find P(no calls in a minute) and P(at most 1 call).

λ = 3. P(0) = e⁻³ ≈ 0.0498. P(1) = 3e⁻³ ≈ 0.1494. P(X ≤ 1) ≈ 0.199.

8. If E(X) = 4 and Var(X) = 2, find E(3X − 1) and Var(3X − 1).

E(3X − 1) = 3 × 4 − 1 = 11. Var(3X − 1) = 3² × 2 = 18 (adding a constant does not change spread).

Common mistakes

Practice quiz

1. For a probability distribution, ΣP(X = x) equals:
2. E(X) for a fair die is:
3. The variance of B(n, p) is:
4. In a Poisson distribution with λ = 4, the variance is:
5. Which is a discrete random variable?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a probability distribution in simple words?

It is a list (table, chart or formula) of every value a random variable can take, together with the chance of each value. The chances add to 1.

What is the difference between a discrete and a continuous distribution?

A discrete one has separate values you can list, with a probability for each. A continuous one covers a range; probability is the area under a density curve.

How do you find the mean and variance of a binomial distribution?

For B(n, p), mean = np and variance = np(1 − p). The standard deviation is the square root of the variance.

Where this is taught

Canada (Ontario)Grade 12B. Probability Distributions
ItalySecondaria di secondo grado – classe 5ª (esame di Stato)Data and prediction
ItalySecondaria di secondo grado – classe 5ª (esame di Stato)Data and prediction
ItalySecondaria di secondo grado – classe 5ª (esame di Stato)Data and prediction
NetherlandsVWO 5Statistics and probability (part 2)
NetherlandsVWO 5Statistics and probability (part 2)
RomaniaClasa a X-aFinancial mathematics
RomaniaClasa a X-aFinancial mathematics
RomaniaClasa a X-aFinancial mathematics
Spain1º BachilleratoStochastic Sense
Spain1º BachilleratoStochastic sense
Spain2º BachilleratoStochastic Sense
Spain2º BachilleratoStochastic Sense
CBSE (India)Class 10Part B: Distributions in Data Science
CBSE (India)Class 12Probability Distributions
England (GCSE, A level)Year 113. Probability
England (GCSE, A level)Year 12Optional application 2 Statistics (part 1)
England (GCSE, A level)Year 13Optional application 2 Statistics (part 2)
Japan高校2年Statistical inference
FranceTerminaleStudy themes
FranceTerminaleContent

Learn first

Related lessons

All Maths lessons