Skip to content
Glacius
ProbabilityConcept reference

Bernoulli trials

A Bernoulli variable records one event as 1 when it occurs and 0 when it does not.

On this page 7 sections
  1. Overview
  2. Model one binary outcome
  3. State what one means
  4. One outcome versus a count
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Model one binary outcome#

A Bernoulli variable records one event as 11 when it occurs and 00 when it does not. Its parameter pp is the probability of the event, with 0p10\le p\le1.

For a binary classifier's correctness indicator, X=1X=1 can mean correct and X=0X=0 incorrect. If its correctness probability under a stated sampling model is 0.80.8, then P(X=1)=0.8P(X=1)=0.8 and P(X=0)=0.2P(X=0)=0.2.

02State what one means#

Writing XBernoulli(p)X\sim\operatorname{Bernoulli}(p) specifies the two possible values and their probabilities. The meaning of success is chosen by the model; it need not be a desirable outcome. You could instead define 11 as an error, changing the parameter.

If 11 means error with probability 0.20.2, the two masses are 0.20.2 at one and 0.80.8 at zero. The underlying events have not changed, but the numerical encoding has.

Check your reasoning

X is Bernoulli(0.3). What are P(X=0), P(X=1)?

  1. A(0.7,0.3)
  2. B(0.3,0.7)
  3. C(0,1)
Show answer and explanation
(0.7,0.3)

Probability p belongs to value one; the remaining mass belongs to zero.

03One outcome versus a count#

A count of successes across several trials generally takes values beyond zero and one, so it is not a single Bernoulli variable. Its individual trial indicators may be Bernoulli variables. Independence assumptions belong to a model of the collection, not to the definition of one indicator.

At p=0p=0, the variable is always zero. At p=1p=1, it is always one. Both boundary cases are valid distributions. A probability outside the interval from zero to one is invalid.

Check your reasoning

A trial fails with probability 0.2. A draft defines X=1 for failure but sets p=0.8. Repair p.

  1. A0.8
  2. B0.2
  3. C−0.2
Show answer and explanation
0.2

The parameter must refer to the event encoded as one.

When using a Bernoulli model for a binary label, say what the label represents and which population or condition defines pp. One binary observation does not establish the probability by itself.

Key takeaway

Model a binary outcome with a Bernoulli distribution.

  • Model a binary outcome with a Bernoulli distribution.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Bernoulli trials.” Math behind ML. /learn/p-bernoulli