Bernoulli Distribution – Explanation & Examples

The definition of the Bernoulli distribution is:

“The Bernoulli distribution is a discrete probability distribution that describes the probability of a random variable with only two outcomes.”

In this topic, we will discuss the Bernoulli distribution from the following aspects:

  1. What is a Bernoulli distribution?
  2. When to use Bernoulli distribution?
  3. Bernoulli distribution formula.
  4. Practice questions.
  5. Answer key.

1. What is a Bernoulli distribution?

The Bernoulli distribution is a discrete probability distribution that describes the probability of a random variable with only two outcomes.

In the random process called a Bernoulli trial, the random variable can take one outcome, called a success, with a probability p, or take another outcome, called failure, with a probability q = 1-p.

The success outcome is denoted as 1 and the failure outcome is denoted as 0.

The Bernoulli distribution is a special case of the binomial distribution where a single trial is conducted and the binomial distribution is the sum of repeated Bernoulli trials.

The Bernoulli distribution was named after the Swiss mathematician Jacob Bernoulli.

– Example 1

Tossing a coin can result in only two possible outcomes (head or tail). We call one of these outcomes (head) a success and the other (tail), a failure.

The probability of success (p) or head is 0.5 for a fair coin. The probability of failure (q) or tail = 1-p = 1-0.5 = 0.5.

If we denote head as 1 and tail as 0, we can plot this Bernoulli distribution as follows:

We have two outcomes:

  • Tail or 0 with a probability of 0.5.
  • Head or 1 with a probability of 0.5 also.

This is an example of a probability mass function where we have the probability for each outcome.

– Example 2

We have an unfair coin where the probability of success (p) or head is 0.8 and the probability of failure (q) or tail = 1-p = 1-0.8 = 0.2.

If we denote head as 1 and tail as 0, we can plot this Bernoulli distribution as follows:

We have two outcomes:

  • Tail or 0 with a probability of 0.2.
  • Head or 1 with a probability of 0.8.

– Example 3

The prevalence of a certain disease in the general population is 10%.

If we randomly select a person from this population, we can have only two possible outcomes (diseased or healthy person). We call one of these outcomes (diseased person) success and the other (healthy person), a failure.

The probability of success (p) or diseased person is 10% or 0.1. So, the probability of failure (q) or healthy person = 1-p = 1-0.1 = 0.9.

If we denote diseased person as 1 and healthy person as 0, we can plot this Bernoulli distribution as follows:

We have two outcomes:

  • A healthy person or 0 with a probability of 0.9.
  • A diseased person or 1 with a probability of 0.1.

– Example 4

In the above example of disease prevalence of 10%, if We are interested in healthy persons and call the healthy person a success and the diseased person, a failure.

The probability of success (p) or healthy person is 90% or 0.9. So, the probability of failure (q) or diseased person = 1-p = 1-0.9 = 0.1.

If we denote a healthy person as 1 and diseased person as 0, we can plot this Bernoulli distribution as follows:

We have two outcomes:

  • A healthy person or 1 with a probability of 0.9.
  • A diseased person or 0 with a probability of 0.1.

2. When to use Bernoulli distribution?

For a random variable to be described by the Bernoulli distribution:

  1. The random variable can take only one of two possible outcomes. We call one of these outcomes a success and the other, a failure.
  2. The probability of success, denoted by p, is the same in every Bernoulli trial.
  3. The trials are independent, meaning that the outcome in one trial does not affect the outcome in other trials.

We can determine the Bernoulli distribution from the results of different Bernoulli trials.

– Example 1

You are tossing a coin. The random variable equals to 1 if you get a head and 0 if you get a tail.

You tossed the coin 100 times and get the following results:

0 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 1 0 0 1.

What is the Bernoulli distribution for this coin?

You can use that data to estimate the probability mass function (or the probability distribution) for tossing this coin.

1. We construct a frequency table for each outcome.

Outcome

frequency

0

53

1

47

2. Add another column for the probability of each outcome.

Probability = frequency/total number of data = frequency/100.

Outcome

frequency

probability

0

53

0.53

1

47

0.47

The probabilities are >= 0 and sum to 1.

This is a likely fair coin where the probability of heads nearly equals the probability of tails = 0.5.

We do not get exactly 50 heads and 50 tails due to randomness in the process but we get a good approximation to the probability of the fair coin = 0.5.

3. Use the table to plot the Bernoulli distribution for that coin:

We have two outcomes:

  • Head or 1 with a probability of 0.47.
  • Tail or 0 with a probability of 0.53.

– Example 2

You screened 50 individuals from a certain population for the presence of hypertension and get the following results:

ID

condition

1

normotensive

2

normotensive

3

normotensive

4

normotensive

5

normotensive

6

normotensive

7

normotensive

8

normotensive

9

normotensive

10

normotensive

11

hypertensive

12

normotensive

13

normotensive

14

normotensive

15

normotensive

16

normotensive

17

normotensive

18

normotensive

19

normotensive

20

hypertensive

21

normotensive

22

normotensive

23

normotensive

24

hypertensive

25

normotensive

26

normotensive

27

normotensive

28

normotensive

29

normotensive

30

normotensive

31

hypertensive

32

normotensive

33

normotensive

34

normotensive

35

normotensive

36

normotensive

37

normotensive

38

normotensive

39

normotensive

40

normotensive

41

normotensive

42

normotensive

43

normotensive

44

normotensive

45

normotensive

46

normotensive

47

normotensive

48

normotensive

49

normotensive

50

normotensive

What is the estimated Bernoulli distribution for hypertension in this population?

1. We construct a frequency table for each outcome.

Outcome

frequency

hypertensive

4

normotensive

46

2. Add another column for the probability of each outcome. As we are interested in hypertension, so we denote hypertensive persons as 1 and normotensive persons as 0.

Probability = frequency/total number of data = frequency/50.

outcome

frequency

probability

1

4

0.08

0

46

0.92

The probabilities are >= 0 and sum to 1.

3. Use the table to plot the Bernoulli distribution for hypertension: