HSC Study

Bernoulli Random Variables

Modelling a single two-outcome trial with a Bernoulli random variable, choosing suitable contexts, and deriving and using its mean p and variance p(1 − p).

30 min · Statistical Analysis

The full teaching. Start here.

The short version

  • A Bernoulli trial has two outcomes, success and failure, with .
  • The Bernoulli random variable is for success and for failure: , .
  • and .
  • Any single event can be made into a Bernoulli trial: success is "the event happens".
  • The variance is largest, , when , and zero when or .

Two-outcome situations

Many random experiments come down to a yes-or-no question. Does the free throw go in? Is the item faulty? Does the patient respond to treatment? We call one outcome a success (not necessarily a good thing, just the outcome we are counting) and the other a failure.

Bernoulli random variable

A random variable that takes the value (success) with probability and (failure) with probability . It counts the number of successes in one trial. The number is its parameter.

Even an experiment with many outcomes can be modelled this way once you decide what counts as a success. Rolling a die has six outcomes, but "roll a " is a Bernoulli trial with .

Worked example3 marks

Choosing a Bernoulli model

For each situation, decide whether a Bernoulli random variable is a suitable model. If so, define and state . (a) A card is drawn from a standard deck; we note whether it is a picture card (J, Q, K). (b) The time a student takes to run m. (c) A seed is planted and we note whether it germinates; from past records, of seeds do.

(a) Two outcomes

Picture card or not.

Yes. if the card is a picture card. There are picture cards, so .

(b) Many outcomes

Time is continuous.

Not as it stands: time takes a continuum of values. It could be made Bernoulli by asking a yes-or-no question, such as "under seconds?", but we would need data to estimate .

(c) Two outcomes, p from data

Germinates or not.

Yes. if the seed germinates, with estimated from the records.

Answer

(a) Bernoulli, . (b) Not Bernoulli unless recast as a yes-or-no question. (c) Bernoulli, .

Is that answer sensible?

In each Bernoulli case, : for (a), .

CheckpointAnswer before reading on.

Which situation is best modelled by a single Bernoulli random variable?

Select one answer

Hint 1Exactly two outcomes.

Hint 2One trial.

Hint 3Success or failure.

CheckpointAnswer before reading on.

A die is rolled once. How can this be modelled as a Bernoulli random variable?

Select one answer

Hint 1Two outcomes needed.

Hint 2Group the outcomes.

Hint 3Define a success.

CheckpointAnswer before reading on.

For a Bernoulli random variable with parameter , which is correct?

Select one answer

Hint 1X is 0 or 1.

Hint 2.

Hint 3.

CheckpointAnswer before reading on.

A Bernoulli random variable counts:

Select one answer

Hint 1One trial.

Hint 2Number of successes.

Hint 30 or 1.

CheckpointAnswer before reading on.

A student models "it rains tomorrow" and "it rains the day after" as independent Bernoulli trials with the same p. What is the main weakness?

Select one answer

Hint 1Consecutive days.

Hint 2Weather persists.

Hint 3Independence.

Mean and variance

Worked example2 marks

Deriving the mean and variance

Show that a Bernoulli random variable with parameter has and .

Mean

E(X) = Σ x P(X = x).

.

E(X²)

Needed for the variance.

.

Variance

Var(X) = E(X²) − [E(X)]².

.

Answer

and .

Is that answer sensible?

A fair coin (): the values and are each from the mean , so the variance is , and . Correct.

The mean is the long-run proportion of successes: averaging many s and s gives the fraction of s. The variance is zero when the outcome is certain ( or ) and largest when success and failure are equally likely.

CheckpointAnswer before reading on.

is a Bernoulli random variable with . Find .

Hint 1.

Hint 20.3.

Hint 3.

CheckpointAnswer before reading on.

is a Bernoulli random variable with . Find .

Hint 1.

Hint 2.

Hint 30.21.

CheckpointAnswer before reading on.

is a Bernoulli random variable with . Find the standard deviation of .

Hint 1Variance .

Hint 20.16.

Hint 3Square root.

CheckpointAnswer before reading on.

is a Bernoulli random variable with . Find .

Hint 1 when X is 0 or 1.

Hint 2.

Hint 30.3.

CheckpointAnswer before reading on.

A Bernoulli random variable has mean . Find its variance.

Hint 1.

Hint 2.

Hint 30.2275.

CheckpointAnswer before reading on.

For which value of p is the variance of a Bernoulli random variable largest?

Hint 1 is a parabola.

Hint 2Symmetric about 1/2.

Hint 30.5.

CheckpointAnswer before reading on.

Compare the variances of Bernoulli variables with and .

Select one answer

Hint 1.

Hint 2 and .

Hint 3Equal.

CheckpointAnswer before reading on.

A biased coin shows heads with probability . Let for heads. Find .

Hint 1.

Hint 2.

Hint 30.24.

Exam question

Standard · about 3 min

2 marks

Show that a Bernoulli random variable with parameter has and . (2 marks)

Hint 1.

Hint 2.

Hint 3.

Where students lose marks on this one
  • Writing Var = E(X) − E(X)² without justifying E(X²) = p.

    Why it happens: Skipping a step.

    Show E(X²) = p.

Written for this site.

Exam question

Harder · about 3 min

2 marks

Show that for every Bernoulli random variable, and state when equality holds. (2 marks)

Hint 1Complete the square.

Hint 2.

Hint 3A square is non-negative.

Where students lose marks on this one
  • Testing a few values of p.

    Why it happens: Arguing from examples.

    Complete the square for a general proof.

Written for this site.

Exam question

Standard · about 3 min

2 marks

A Bernoulli random variable has variance . Find the possible values of . (2 marks)

Hint 1.

Hint 2.

Hint 3.

Where students lose marks on this one
  • Giving only p = 0.2.

    Why it happens: Missing the symmetric solution.

    p and 1 − p give the same variance.

Written for this site.

Common mistake

For p = 0.3, Var(X) = 0.3² = 0.09.

Why it happens: Confusing E(X²) or [E(X)]² with the variance.

The variance is . Note that because for a variable that is only ever or .

Practical problems

In context, state what a success is, give , and interpret the mean as a long-run proportion. Bernoulli variables are also handy as indicators: to find the expected number of events that happen, add the probabilities of each event, whether or not the events are independent.

Worked example3 marks

A Bernoulli model in practice

A basketballer makes of free throws. Each throw earns point if it goes in and otherwise. (a) Define a Bernoulli random variable for one throw and state its distribution. (b) Find the mean and standard deviation of the points from one throw. (c) A team has players who make , , , and of free throws. Each takes one throw. Find the expected number of successful throws.

(a) Define X

Success is scoring.

if the throw goes in and otherwise: , .

(b) Mean and standard deviation

E(X) = p, Var(X) = p(1 − p).

and , so the standard deviation is .

(c) Add indicators

Each throw is Bernoulli with its own p.

The expected number is the sum of the means: .

Answer

(a) is Bernoulli with . (b) Mean , standard deviation about . (c) successful throws.

Is that answer sensible?

(c) The answer lies between and , and equals times the average success rate of .

CheckpointAnswer before reading on.

A card is drawn from a standard deck. Let X = 1 if it is a heart and 0 otherwise. Find Var(X).

Hint 1.

Hint 2.

Hint 30.1875.

CheckpointAnswer before reading on.

In 100 independent Bernoulli trials there were 30 successes. What is the natural estimate of p?

Select one answer

Hint 1Proportion of successes.

Hint 230/100.

Hint 30.3.

CheckpointAnswer before reading on.

A Bernoulli trial with success probability p is repeated many times, recording 0 or 1 each time. The average of the recorded values approaches:

Select one answer

Hint 1Average of 0s and 1s.

Hint 2Proportion of 1s.

Hint 3p.

CheckpointAnswer before reading on.

is Bernoulli with . A game pays for a success and charges to play, so the profit is . Find .

Hint 1.

Hint 2.

Hint 32.

Exam question

Standard · about 3 min

2 marks

A machine produces a faulty item with probability 0.05. Let X = 1 if an item is faulty and 0 if not. Find E(X) and Var(X), and interpret E(X). (2 marks)

Hint 1.

Hint 2.

Hint 3Long-run proportion.

Where students lose marks on this one
  • Interpreting E(X) as "the item is 0.05 faulty".

    Why it happens: Misreading the mean.

    The mean is a long-run average of 0s and 1s.

Written for this site.

Exam question

Harder · about 3 min

2 marks

A quiz has three independent questions, answered correctly with probabilities , and . Using indicator (Bernoulli) variables, find the expected number of correct answers.

Hint 1One Bernoulli per question.

Hint 2Expectations add.

Hint 30.9 + 0.7 + 0.5.

Where students lose marks on this one
  • Multiplying the probabilities.

    Why it happens: Finding P(all correct) instead.

    The mean of a sum is the sum of the means.

Written for this site.

What lifts this to a Band 6

Always define the random variable in words before calculating: "Let if the item is faulty and otherwise, so is Bernoulli with ." It costs one line, it makes clear what "success" means, and it is the setup the binomial distribution builds on.

Building bigger distributions from Bernoulli pieces

Bernoulli variables are the atoms of discrete probability. Add independent Bernoulli variables with the same and you get the binomial distribution, whose mean and variance are just copies of and added together. Divide that sum by and you get the sample proportion, the subject of the last lesson in this topic. Even the expected number of fixed points of a random shuffle of cards is found this way: each card is in its original place with probability , so the expected number is , whatever is.