← Math pathway
MATHEMATICAL UNIT M3

Random variables and the binomial distribution

Expectation, variance and probability mass

45–70 minFirst-year extension

Conceptual and mathematical explanation

A random variable X assigns numbers to experimental outcomes. A discrete probability mass function P(X=k) assigns probabilities to possible countable values, and these probabilities sum to one.

In a Bernoulli trial, success=1 has probability p and failure=0 probability 1−p. The number of successes in n independent trials with common p is X~Binomial(n,p). Independence, fixed n and constant p are model requirements.

Expectation E(X) is a model-based mean, not a guarantee of any particular outcome. Variance Var(X) measures squared deviation from expectation. For the binomial, E(X)=np and Var(X)=np(1−p); SD is its square root.

Key formula

P(X=k)=C(n,k) p^k (1−p)^(n−k) E(X)=np Var(X)=np(1−p)

Worked example: step by step

  1. For 10 independent trials with p=0.30, X~Binomial(10,0.30).
  2. E(X)=10×0.30=3. Var(X)=10×0.30×0.70=2.1 and SD≈1.449.
  3. Exactly two successes: P(X=2)=C(10,2)×0.3²×0.7⁸≈0.2335. Expected three successes does not mean every experiment has three.

Independent exercises

  1. For X~Binomial(4,0.5), find P(X=2).
  2. For X~Binomial(20,0.2), calculate E(X), Var(X) and SD.
  3. Why can dependence make a binomial model misleading?

Written solutions are private in the instructor guide.

Optional base R check

Download R script

n <- 10; p <- 0.30
c(expected=n*p, variance=n*p*(1-p))
dbinom(2, size=n, prob=p)
set.seed(2026)
sim <- rbinom(10000, size=n, prob=p)
c(mean=mean(sim), variance=var(sim))

Formative self-check

1. For Binomial(10,0.3), E(X)?
2. Variance for the same distribution?
3. A condition of the binomial model?

Related core statistics lesson 4