Skip to main content
ExamExplained
NSW · Maths Extension 1
Maths Extension 1 study scene
§-Syllabus dot point
NSWMaths Extension 1Syllabus dot point

What is a Bernoulli trial, and what are its mean and variance?

Define a Bernoulli random variable, compute its mean and variance, and recognise scenarios that fit the model

A focused answer to the HSC Maths Extension 1 dot point on Bernoulli trials. The definition, mean pp, variance p(1p)p (1 - p), and the role of Bernoulli trials as the building block of the binomial distribution.

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

What this dot point is asking

NESA wants you to recognise a Bernoulli trial (a single experiment with two outcomes), state its probability mass function, compute its mean and variance, and see it as the unit of a sequence used to build the binomial distribution.

The answer

Definition

A Bernoulli trial is a random experiment with exactly two possible outcomes, conventionally labelled "success" (value 11) and "failure" (value 00), where success occurs with probability pp and failure with probability q=1pq = 1 - p.

If XX is a Bernoulli random variable with parameter pp (written XB(p)X \sim B(p) or Bern(p)\text{Bern}(p)):

P(X=1)=p,P(X=0)=1p.P(X = 1) = p, \qquad P(X = 0) = 1 - p.

The whole distribution is just two bars: a bar of height q=1pq = 1 - p at x=0x = 0 and a bar of height pp at x=1x = 1. Because something must happen, the two heights add to 11, which is the only consistency check a Bernoulli variable needs.

The Bernoulli probability distributionA two bar probability distribution for a Bernoulli variable with success probability 0.7. The bar at 0 (failure) has height 0.3 and the bar at 1 (success) has height 0.7; the two heights add to 1.xP(X = x)0.510 (failure)q = 0.31 (success)p = 0.7A single trial: P(X = 0) = q and P(X = 1) = p, with p + q = 1.

Mean (expected value)

E(X)=1p+0(1p)=p.E(X) = 1 \cdot p + 0 \cdot (1 - p) = p.

The expected value of a single Bernoulli trial is its success probability.

Variance

E(X2)=12p+02(1p)=p.E(X^2) = 1^2 \cdot p + 0^2 \cdot (1 - p) = p.

Var(X)=E(X2)[E(X)]2=pp2=p(1p).\text{Var}(X) = E(X^2) - [E(X)]^2 = p - p^2 = p(1 - p).

Equivalently, σ=p(1p)\sigma = \sqrt{p (1 - p)}.

Standard examples

  • Flipping a fair coin with X=1X = 1 if heads: p=12p = \tfrac{1}{2}.
  • Rolling a die and checking for a 66: p=16p = \tfrac{1}{6}.
  • Asking a random voter if they support a policy with pp unknown.
  • A medical test giving a positive result on someone with the condition (sensitivity).

Why this matters

A Bernoulli trial is the simplest non-trivial random variable. The binomial distribution counts the number of successes in a fixed number of independent Bernoulli trials.

A sequence of nn independent identically distributed Bernoulli trials, where Xi=1X_i = 1 if the ii-th trial is a success and 00 otherwise, has total S=X1+X2++XnB(n,p)S = X_1 + X_2 + \dots + X_n \sim B(n, p).

By linearity of expectation, E(S)=npE(S) = n p. By independence and the variance addition rule, Var(S)=np(1p)\text{Var}(S) = n p (1 - p).

Recognising a Bernoulli model

The examinable judgement is whether a described situation fits the Bernoulli model at all. Three conditions must hold: there is a single trial (or you are looking at one trial in a sequence), there are exactly two outcomes, and a fixed probability pp is attached to success. If the experiment has three or more outcomes, or a continuous range of outcomes, it is not Bernoulli. Where an outcome with many categories is reframed as "the event of interest happened, or it did not", a Bernoulli model is recovered. This reframing (success versus everything-else) is how almost every binomial question is built.

From one trial to many

The reason this small model matters is that it is the atom from which the binomial distribution is built. Each of nn independent, identically distributed Bernoulli trials contributes its mean pp and variance p(1p)p(1 - p), and because expectation is linear and variance adds for independent variables, the totals are npnp and np(1p)np(1 - p). Understanding that the binomial mean and variance are just nn copies of the Bernoulli mean and variance removes any need to memorise them as separate facts.

Where the variance is largest, stage by stage

A favourite short proof question asks you to show that Var(X)=p(1p)\text{Var}(X) = p(1 - p) is greatest at p=12p = \tfrac{1}{2}. The variance is a function of pp, and seeing its shape makes the result obvious before you differentiate anything. The three panels build that picture up.

Stage 1, pin down the certain cases. At p=0p = 0 failure is guaranteed and at p=1p = 1 success is guaranteed; either way the outcome is certain, so there is no spread and Var(X)=0(10)=0\text{Var}(X) = 0(1 - 0) = 0 and 1(11)=01(1 - 1) = 0. The variance curve must therefore touch zero at both ends of the interval [0,1][0, 1].

Bernoulli variance p(1 minus p)The variance of a Bernoulli trial plotted against p. It is a downward parabola that is zero at p equals 0 and p equals 1 and peaks at one quarter when p equals one half.Var(X) = p(1 - p)00.51p0.25V(0) = 0V(1) = 0Stage 1At p = 0 and p = 1 the outcome is certain, so the variance is 0.

Stage 2, fill in the shape between the ends. Because Var(X)=pp2\text{Var}(X) = p - p^2 is a quadratic with a negative leading coefficient, it is a downward parabola. Pinned to 00 at each end and opening downward, it must bulge up in the middle: uncertainty is small near the certain ends and grows as the two outcomes become more evenly matched.

Bernoulli variance p(1 minus p)The variance of a Bernoulli trial plotted against p. It is a downward parabola that is zero at p equals 0 and p equals 1 and peaks at one quarter when p equals one half.Var(X) = p(1 - p)00.51p0.25Stage 2Between the ends the variance rises and falls: a downward parabola.

Stage 3, locate the peak. By symmetry of a parabola the maximum sits exactly halfway between the roots, at p=12p = \tfrac{1}{2}. Differentiating confirms it: ddp(pp2)=12p=0\frac{d}{dp}(p - p^2) = 1 - 2p = 0 gives p=12p = \tfrac{1}{2}, and the second derivative 2<0-2 < 0 makes it a maximum. The peak value is 1212=14\tfrac{1}{2}\cdot\tfrac{1}{2} = \tfrac{1}{4}, so a fair trial (p=12p = \tfrac{1}{2}) is the most uncertain Bernoulli trial of all.

Bernoulli variance p(1 minus p)The variance of a Bernoulli trial plotted against p. It is a downward parabola that is zero at p equals 0 and p equals 1 and peaks at one quarter when p equals one half.Var(X) = p(1 - p)00.51p0.25max = 1/4 at p = 1/2Stage 3The peak is at p = 1/2, where Var(X) = 1/4: a fair trial is most uncertain.

How exam questions ask about Bernoulli trials

Bernoulli rarely gets a question to itself; it is usually the setup line of a binomial question, or a short part that tests whether you know the parameters and formulas. The wordings to recognise:

  • "A Bernoulli random variable has P(X=1)=P(X = 1) = \ldots" or "a single trial succeeds with probability pp": state E(X)=pE(X) = p and Var(X)=p(1p)\text{Var}(X) = p(1 - p) and substitute. These are usually 1 to 2 mark recall parts.
  • "Show that the variance is greatest / maximised when p=12p = \tfrac{1}{2}": differentiate V(p)=pp2V(p) = p - p^2, set V(p)=0V'(p) = 0, and confirm a maximum with V(p)=2<0V''(p) = -2 < 0 before stating V(12)=14V(\tfrac{1}{2}) = \tfrac{1}{4}.
  • "Does this situation fit a Bernoulli model?" or "explain why X is (not) a Bernoulli variable": check the three conditions out loud, that there is one trial, exactly two outcomes, and a fixed pp. Continuous quantities (a time, a height) and three-or-more-outcome experiments are not Bernoulli unless reframed as "event happened or it did not".
  • "XX counts successes in nn trials": this is the cue that you have left a single Bernoulli trial and entered the binomial; the mean becomes npnp and the variance np(1p)np(1 - p).

Exam-style practice questions

Practice questions written in the style of NESA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

HSC 20232 marksA Bernoulli random variable XX has P(X=1)=0.4P(X = 1) = 0.4. Find E(X)E(X) and Var(X)\text{Var}(X).
Show worked answer →

For a Bernoulli variable, E(X)=pE(X) = p and Var(X)=p(1p)\text{Var}(X) = p(1 - p).

Here p=0.4p = 0.4, so E(X)=0.4E(X) = 0.4.

Var(X)=0.4×0.6=0.24\text{Var}(X) = 0.4 \times 0.6 = 0.24.

HSC 20203 marksA Bernoulli trial has success probability pp. Show that the variance is greatest when p=12p = \frac{1}{2}, and state the maximum variance.
Show worked answer →

The variance is V(p)=p(1p)=pp2V(p) = p(1 - p) = p - p^2, a downward parabola in pp.

Differentiate: V(p)=12pV'(p) = 1 - 2 p. Setting V(p)=0V'(p) = 0 gives p=12p = \frac{1}{2}.

Since V(p)=2<0V''(p) = -2 < 0, this is a maximum.

Maximum variance: V ⁣(12)=1212=14V\!\left( \tfrac{1}{2} \right) = \tfrac{1}{2} \cdot \tfrac{1}{2} = \tfrac{1}{4}.

ExamExplained