Advanced level

Probability trees and the Bernoulli scheme

A multi-stage experiment draws as a tree: probabilities multiply along the branches and add across the paths. That one picture holds the formula for the union of two events, the difference between disjoint and independent events, and the whole Bernoulli scheme — including where its binomial coefficient comes from.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • Inspecting a batch of goods
    From a batch in which 5 per cent of units are faulty, a storekeeper pulls 10 for inspection. The probability that none of them turns out faulty is 0.95 to the tenth power, that is 0.599 — so almost 40 per cent of such inspections catch at least one defect. Had 20 per cent been faulty, a sample of ten would pass the batch only 11 per cent of the time, and that is the whole mathematics behind choosing a sample size.
  • Guessing a multiple-choice test
    A test has 10 questions, each with four options and one correct answer. Guessing is a Bernoulli scheme with p equal to 1/4, so the probability of not a single hit is 0.75 to the tenth power, about 5.6 per cent. The probability of passing with a threshold of 6 correct answers, on the other hand, is only 0.0197 — fewer than 2 cases in 100.
  • Redundancy in a server room
    Three independent servers, each of which fails in a given month with probability 0.02, all go down together with probability 0.02 cubed, that is 0.000008. The service therefore runs 99.9992 per cent of the time, while a single server manages 98 per cent. Two extra machines cut annual downtime from about 175 hours to under 5 minutes.
  • Overlapping groups in a survey
    Of 200 respondents, 90 read the newsletter and 60 follow the social media profile, and 25 people do both. At least one channel therefore reaches 90 + 60 − 25 = 125 people, that is 62.5 per cent of the group — not the 75 per cent a plain addition would give. Those 25 people are exactly the term the union formula subtracts.

All formulas

  • Multiplying along a branch

    P(path)=p1p2pnP(\text{path}) = p_1 \cdot p_2 \cdot \ldots \cdot p_n

    the probability of one path of the tree

  • Adding across paths

    P(A)=pathsAP(path)P(A) = \sum_{\text{paths} \subset A} P(\text{path})

    an event is a set of paths, so they add

  • Union of events

    P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)

    the overlap is counted twice, so subtracted once

  • Disjoint events

    AB=    P(AB)=P(A)+P(B)A \cap B = \varnothing \implies P(A \cup B) = P(A) + P(B)

    nothing to subtract

  • Bernoulli scheme

    P(X=k)=(nk)pk(1p)nkP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}

    k successes in n independent trials

  • At least one success

    P(X1)=1(1p)nP(X \geq 1) = 1 - (1-p)^n

    through the complement, with no summing

The previous lesson drew trees to show total probability and Bayes’ theorem. The picture did the work, but its rules were never named. We name them now — and then find that one particular tree recurs so often that it has earned a formula of its own.

The two rules of a tree

A multi-stage experiment is recorded as a probability tree: a level is a stage, a branch is a possible outcome of that stage, and the number on a branch is the probability of that outcome given what has already happened.

Two rules govern it, and it is worth knowing where each comes from:

  • multiply along a branch — this is the multiplication rule P(AB)=P(B)P(AB)P(A \cap B) = P(B) \cdot P(A|B) of the previous lesson;
  • add across paths — legitimate because different paths exclude one another, so the sum counts nothing twice.
urnwhite 3/5white 2/46/20black 2/46/20black 2/5white 3/46/20black 1/42/20
Two draws without replacement from an urn holding 3 white balls and 2 black. The numbers on the second level differ between the two nodes — because the urn looks different after the first draw. The four outcomes add up to 20/20, that is to one.
Two balls are drawn without replacement from an urn with 3 white balls and 2 black. What is the probability of drawing exactly one white?

Disjoint is not independent

This is the pair of ideas confused most often, and the difference is not subtle — they actually rule each other out.

disjointindependent
meaningcannot happen togetherone does not affect the other
formulaP(AB)=0P(A \cap B) = 0P(AB)=P(A)P(B)P(A \cap B) = P(A) \cdot P(B)
in a unionP(A)+P(B)P(A) + P(B)subtract P(A)P(B)P(A) \cdot P(B)

Take a die roll, with AA — an even number — and BB — an odd one. The events are disjoint, since AB=A \cap B = \varnothing. Are they independent? Check:

P(AB)=0,P(A)P(B)=1212=14P(A \cap B) = 0, \qquad P(A) \cdot P(B) = \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}

They are not. Nor is this an accident of this die: two disjoint events of non-zero probability are never independent — because learning that AA occurred drops the chance of BB to zero, and that is the largest change there is.

Independence does turn up between different experiments or different stages: two coin tosses, two draws with replacement, the failures of two separate servers.

The union of two events

The event ABA \cup B occurs when AA occurs, when BB occurs, or when both do. Plain addition P(A)+P(B)P(A) + P(B) counts the overlap twice, so it has to be subtracted once:

P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)

For disjoint events the last term vanishes and only the addition is left — exactly what the rule about adding across paths rests on.

One card is drawn from a 52-card deck. What is the probability that it is a heart or a king?

The Bernoulli scheme

The tree drawn most often is the one whose levels all look the same. We speak of a Bernoulli scheme when three conditions hold at once:

  1. every trial has exactly two outcomes — success and failure;
  2. the probability of success pp is the same in every trial;
  3. the trials are independent.

Coin tosses, draws with replacement and successive units from a very large batch fit that description. Drawing without replacement from a small set — as in the urn tree above — does not, because pp changes after every step.

startH 1/2H 1/2H 1/21/8T 1/21/8T 1/2H 1/21/8T 1/21/8T 1/2H 1/2H 1/21/8T 1/21/8T 1/2H 1/21/8T 1/21/8
Three coin tosses. All eight paths carry the same probability 1/8, because each multiplies three identical factors. Three of them show exactly two heads — as many as there are ways of choosing two positions out of three.

The drawing contains the whole formula. Every path with kk successes multiplies pp exactly kk times and q=1pq = 1-p exactly nkn-k times, so it carries probability pkqnkp^k q^{n-k}whatever the order. There are as many such paths as there are ways of choosing kk positions out of nn, that is (nk)\binom{n}{k}, the combinations of the counting lesson. Hence

P(X=k)=(nk)pk(1p)nkP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}
A die is rolled 5 times. What is the probability that a six comes up exactly twice?

At least one success

The question “will it happen even once” comes up so often in this scheme that a shortcut is worth having. Summing from k=1k = 1 to k=nk = n is the wrong method here, not merely the slow one: the complement is a single term.

P(X1)=1P(X=0)=1(1p)nP(X \geq 1) = 1 - P(X = 0) = 1 - (1-p)^n
A batch contains 5% faulty units. Ten units are drawn. What is the probability of hitting at least one faulty one?

Exercises

The set asks three things, in the order of the lesson. The P(AB)P(A \cup B) prompt gives P(A)P(A), P(B)P(B) and P(AB)P(A \cap B) — the union formula has to be assembled, subtraction included. The P(AB)P(A \cap B) prompt gives P(A)P(A) and P(BA)P(B|A), that is two branches of one path, and asks for their product. The P(X=k)P(X = k) prompt gives the number of trials nn and the success probability pp, so it asks for the Bernoulli formula directly.

In every case the answer is a fraction in lowest terms.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
P(A∪B): P(A) = 7/10, P(B) = 3/5, P(A∩B) = 1/2

The generator does not ask for a “disjoint or independent” verdict — the answer would be a word rather than a number. That distinction is in the table and in the die counterexample above, and it is worth returning to, because it recurs in every problem about a union of events.

Common mistakes

  • Confusing disjointness with independence — the first says “not together”, the second “no influence”. Disjoint events of non-zero probability are never independent.
  • Adding P(A)+P(B)P(A) + P(B) for events that can happen together — the overlap gets counted twice. A result larger than one is the commonest symptom.
  • Multiplying the probabilities of stages that are not independent — on a tree the second number is conditional; when drawing without replacement it differs at every node.
  • Dropping the binomial coefficient from the Bernoulli formulapkqnkp^k q^{n-k} is the probability of one path, and there are (nk)\binom{n}{k} of them.
  • Applying the Bernoulli scheme to drawing without replacement — there pp is not constant and the trials are not independent, so the formula simply does not hold.
  • Computing “at least one” by summing every k1k \geq 1 — one calculation on the complement gives the same answer and has nothing in it to lose.

Formula card

Topic: Trees and the Bernoulli scheme

  • Multiplying along a branch

    P(path)=p1p2pnP(\text{path}) = p_1 \cdot p_2 \cdot \ldots \cdot p_n

    the probability of one path of the tree

  • Adding across paths

    P(A)=pathsAP(path)P(A) = \sum_{\text{paths} \subset A} P(\text{path})

    an event is a set of paths, so they add

  • Union of events

    P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)

    the overlap is counted twice, so subtracted once

  • Disjoint events

    AB=    P(AB)=P(A)+P(B)A \cap B = \varnothing \implies P(A \cup B) = P(A) + P(B)

    nothing to subtract

  • Bernoulli scheme

    P(X=k)=(nk)pk(1p)nkP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}

    k successes in n independent trials

  • At least one success

    P(X1)=1(1p)nP(X \geq 1) = 1 - (1-p)^n

    through the complement, with no summing

startH 1/2H 1/2H 1/21/8T 1/21/8T 1/2H 1/21/8T 1/21/8T 1/2H 1/2H 1/21/8T 1/21/8T 1/2H 1/21/8T 1/21/8
Three coin tosses as a tree. Eight paths, each of probability 1/8 — because every one of them multiplies three branches worth 1/2. Exactly two heads happen on three of them, and that count is the binomial coefficient in the Bernoulli formula.

Frequently asked questions

Related articles