The Bernoulli Random Variable
Flip one biased coin. Inspect one component. Ask one survey question with a yes/no answer. Every one of these is a single Bernoulli trial — a random variable that takes the value 1 (success) with probability $p$ or 0 (failure) with probability $1-p$. Master Bernoulli today, and the binomial distribution in the next lesson is just $n$ Bernoulli trials added together.
A single die is rolled. Let $X = 1$ if the result is a 6, and $X = 0$ otherwise. Before using any formula, write down (a) $P(X=1)$, (b) $E(X)$, and (c) describe in words what "variance of $X$" should measure.
Every Bernoulli question rewards two habits: identify the single trial and its success, then apply the two formulas $E(X) = p$ and $\text{Var}(X) = p(1-p)$. The trap is recognising that something is a single Bernoulli trial rather than a larger experiment.
The name-the-success strategy: (1) confirm a single trial with exactly two outcomes, (2) define success precisely (e.g. "die shows 6"), (3) read off $p = P(\text{success})$, (4) apply $E(X) = p$ and $\text{Var}(X) = p(1-p)$.
$X \sim \text{Bernoulli}(p)$: $P(X=1) = p$, $P(X=0) = 1-p$, $E(X) = p$, $\text{Var}(X) = p(1-p)$
Key facts
- Bernoulli RV: $X \in \{0,1\}$ with $P(X=1) = p$ and $P(X=0) = 1-p$
- $E(X) = p$
- $\text{Var}(X) = p(1-p)$
- Standard deviation $\sigma = \sqrt{p(1-p)}$
Concepts
- Why the Bernoulli is the "atom" from which the binomial is built
- Why variance is largest at $p = 0.5$ — the trial is most "surprising" there
- How to interpret $E(X) = p$ as a long-run proportion of successes
Skills
- Identify a real-world situation as a single Bernoulli trial
- Compute $E(X)$, $\text{Var}(X)$, and $\sigma(X)$ from a given $p$
- Derive $E(X)$ and $\text{Var}(X)$ from first principles using $\sum x p$ and $\sum (x-\mu)^2 p$
A Bernoulli random variable $X$ is the simplest non-trivial RV: it takes only two values, 0 and 1, with probabilities $1-p$ and $p$ respectively. The distribution table is:
Derivation of $E(X)$. Using the definition of expected value:
- $E(X) = \displaystyle\sum_x x\,P(X=x) = 0\cdot(1-p) + 1\cdot p = p$.
Worked through the hook: A biased coin with $p = 0.3$. Then $E(X) = 0.3$ and $\text{Var}(X) = 0.3 \times 0.7 = 0.21$. The variance is maximised when $p = 0.5$ — you can see this by differentiating $p(1-p) = p - p^2$ to get $1 - 2p = 0$, so $p = 0.5$ and $\text{Var}_{\max} = 0.25$.
A Bernoulli RV $X$: $P(X=0)=1-p$, $P(X=1)=p$. Results: $E(X)=p$; $\text{Var}(X)=p(1-p)$.
Pause — copy the Bernoulli distribution table, the derivation $E(X)=0\cdot(1-p)+1\cdot p=p$, and the result $\text{Var}(X)=p(1-p)$ into your book.
Quick check: A fair coin is tossed once. Let $X = 1$ if heads, $X = 0$ if tails. What is $\text{Var}(X)$?
We just saw that a Bernoulli RV $X$ has $E(X)=p$, derived from $E(X)=0\cdot(1-p)+1\cdot p=p$. That raises a question: how do you compute $\text{Var}(X)$ for this simplest random variable, and why does the formula $p-p^2=p(1-p)$ emerge? This card answers it → since $X\in\{0,1\}$, $X^2=X$, so $E(X^2)=p$, and $\text{Var}(X)=p-p^2=p(1-p)$.
To prove the variance formula, use $\text{Var}(X) = E(X^2) - [E(X)]^2$.
Step 1. Compute $E(X^2)$. Since $X \in \{0,1\}$ we have $X^2 = X$, so:
Step 2. Substitute into the variance formula:
The clever step is recognising $X^2 = X$ for a 0/1 variable, which makes $E(X^2) = E(X) = p$ and the algebra collapses to $p - p^2$. Alternatively, using the direct definition: $\text{Var}(X) = (0-p)^2(1-p) + (1-p)^2 p = p^2(1-p) + (1-p)^2 p = p(1-p)[p + (1-p)] = p(1-p)$.
To prove the variance formula, use $\text{Var}(X) = E(X^2) - [E(X)]^2$.
Pause — copy the variance proof: because $X^2=X$ for $X\in\{0,1\}$, we get $E(X^2)=p$, so $\text{Var}(X)=E(X^2)-[E(X)]^2=p-p^2=p(1-p)$ into your book.
Did you get this? True or false: for $X \sim \text{Bernoulli}(p)$ with $p = 0.8$, the variance is $0.8 \times 0.2 = 0.16$, and the standard deviation is $0.4$.
Worked examples · 3 in a row, reveal as you go
A factory produces light bulbs. The probability that any individual bulb is defective is $p = 0.05$. Let $X = 1$ if a randomly chosen bulb is defective, $X = 0$ otherwise. Find (a) $E(X)$, (b) $\text{Var}(X)$, (c) $\sigma(X)$.
A random variable $X$ takes value 1 with probability $p$ and 0 with probability $1-p$. Using the definitions $E(X) = \sum x P(X=x)$ and $\text{Var}(X) = \sum (x - \mu)^2 P(X=x)$, derive expressions for $E(X)$ and $\text{Var}(X)$.
A multiple-choice question has 5 options with exactly one correct answer. A student guesses at random. Let $X = 1$ if the guess is correct, $X = 0$ otherwise. Find $E(X)$ and $\sigma(X)$, and interpret each in plain language.
Fill the gap: A single die is rolled. Let $X = 1$ if the result is a 6, $X = 0$ otherwise. Then $X \sim \text{Bernoulli}(1/6)$, $E(X) = 1/6$, and $\text{Var}(X) = \dfrac{1}{6}\cdot\dfrac{5}{6} = \dfrac{}{36}$.
Misconceptions to fix · the 3 traps that cost marks
Did you get this? True or false: $\text{Var}(X)$ for a Bernoulli RV is maximised when $p = 1$.
Activities · practice with the ideas
A biased coin lands heads with probability $p = 0.4$. Let $X = 1$ if heads, $X = 0$ if tails. Find $E(X)$, $\text{Var}(X)$, and $\sigma(X)$.
For what value of $p$ is the variance of a Bernoulli RV maximised, and what is that maximum value? Justify by differentiating $p(1-p)$.
A pollster asks a random voter whether they support party A. The proportion of party-A supporters in the population is $0.55$. Let $X = 1$ if the voter supports party A, $X = 0$ otherwise. Find $E(X)$ and $\sigma(X)$.
Use the formula $\text{Var}(X) = E(X^2) - [E(X)]^2$ to verify that $\text{Var}(X) = p(1-p)$ for a Bernoulli RV. (Hint: $X^2 = X$.)
If $X \sim \text{Bernoulli}(p)$ with $\sigma(X) = 0.3$, find the two possible values of $p$.
Odd one out: Three of these statements about $X \sim \text{Bernoulli}(0.3)$ are correct. Which one is NOT?
Earlier you considered a biased coin with $p = 0.3$ and were asked for $E(X)$, $\text{Var}(X)$, and which value of $p$ maximises the variance.
The answers are $E(X) = 0.3$ and $\text{Var}(X) = 0.3 \times 0.7 = 0.21$. The variance is maximised at $p = 0.5$, giving $\text{Var}_{\max} = 0.25$. The intuition: when the trial is most "balanced" (50/50), the outcome is most uncertain, so the spread is greatest. When $p$ is close to 0 or 1, the outcome is almost certain and the variance shrinks toward 0.
Pick your answer, then rate your confidence — that tells the system what to drill next. Each retry pulls a fresh mix from the bank.
Q1. Let $X \sim \text{Bernoulli}(0.7)$. Find $E(X)$ and $\text{Var}(X)$. (2 marks)
Q2. A factory's defect rate is $p$. Let $X = 1$ if a randomly chosen item is defective. Show from first principles that $\text{Var}(X) = p(1-p)$. (3 marks)
Q3. A Bernoulli random variable $X$ has $\sigma(X) = 0.4$. (i) Find $\text{Var}(X)$. (ii) Hence find the two possible values of $p$. (iii) For each value, state $E(X)$. (3 marks)
Comprehensive answers (click to reveal)
Activity answers:
1. $E(X) = 0.4$. $\text{Var}(X) = 0.4 \times 0.6 = 0.24$. $\sigma = \sqrt{0.24} \approx 0.490$.
2. $\dfrac{d}{dp}[p - p^2] = 1 - 2p = 0 \Rightarrow p = 0.5$. Maximum variance $= 0.5 \times 0.5 = 0.25$.
3. $E(X) = 0.55$. $\text{Var}(X) = 0.55 \times 0.45 = 0.2475$. $\sigma = \sqrt{0.2475} \approx 0.497$.
4. $X \in \{0,1\} \Rightarrow X^2 = X$, so $E(X^2) = E(X) = p$. Therefore $\text{Var}(X) = E(X^2) - [E(X)]^2 = p - p^2 = p(1-p)$. $\square$
5. $\sigma^2 = 0.09 = p(1-p) \Rightarrow p^2 - p + 0.09 = 0$. Quadratic formula: $p = \dfrac{1 \pm \sqrt{1 - 0.36}}{2} = \dfrac{1 \pm \sqrt{0.64}}{2} = \dfrac{1 \pm 0.8}{2}$, giving $p = 0.9$ or $p = 0.1$.
Q1 (2 marks): $E(X) = 0.7$ [1]. $\text{Var}(X) = 0.7 \times 0.3 = 0.21$ [1].
Q2 (3 marks): $E(X) = 0(1-p) + 1(p) = p$ [1]. $\text{Var}(X) = (0-p)^2(1-p) + (1-p)^2 p = p^2(1-p) + (1-p)^2 p$ [1] $= p(1-p)[p + (1-p)] = p(1-p)(1) = p(1-p)$. $\square$ [1]
Q3 (3 marks): (i) $\text{Var}(X) = 0.4^2 = 0.16$ [1]. (ii) $p(1-p) = 0.16 \Rightarrow p^2 - p + 0.16 = 0 \Rightarrow p = \dfrac{1 \pm \sqrt{1 - 0.64}}{2} = \dfrac{1 \pm 0.6}{2}$, so $p = 0.8$ or $p = 0.2$ [1]. (iii) $E(X) = 0.8$ or $E(X) = 0.2$ correspondingly [1].
Five timed questions on Bernoulli mean, variance, standard deviation, and first-principles derivations. Beat the boss to bank a tier — gold (90% + speed), silver (75%), or bronze (50%). Replays welcome.
⚔ Enter the arenaClimb platforms by answering Bernoulli questions. Lighter alternative to the boss.
Mark lesson as complete
Tick when you've finished the practice and review.