Skip to content

The law of total probability and the reverse question

The law of total probability and the reverse question

The law of total probability

An outcome of the second stage appears in a tree at the end of several paths – one path for each outcome of the first stage. Its probability is the sum of these paths.

A shop gets its phones from two suppliers.
60% of the phones come from supplier A, and 2% of them are faulty.
40% come from supplier B, and 5% of them are faulty.
A phone is chosen at random. F\displaystyle F – the phone is faulty; A\displaystyle A – it is from supplier A.

A faulty phone has two paths: from supplier A and from supplier B.

P(F)=0.6⋅0.02+0.4⋅0.05=0.012+0.02=0.032P(F)=0.6\cdot0.02+0.4\cdot0.05=0.012+0.02=0.032

In general, when the first stage has two outcomes, A\displaystyle A and A‾\displaystyle \overline{A}:

P(F)=P(A)⋅P(F/A)+P(A‾)⋅P(F/A‾)\displaystyle P(F)=P(A)\cdot P(F/A)+P(\overline{A})\cdot P(F/\overline{A})

This is the law of total probability. When the first stage has three outcomes or more, a path is added for each of them.

Total probability in the area model

In the area model the same calculation is a sum of areas. The square is cut into two strips by the supplier, and each strip is cut by faulty or working. The area of each rectangle is the probability of its path.

The “faulty” rectangles are small – 0.012\displaystyle 0.012 and 0.02\displaystyle 0.02 – and their sum is P(F)=0.032\displaystyle {P(F)}={0.032}. The rectangle of supplier B is the larger of the two, although supplier B’s strip is narrower.

The reverse question

In a tree the probabilities of the second stage are given the first stage. In the reverse question, what happened at the second stage is known, and the question is about the first stage. The answer: the path that answers the question, divided by the probability of what is known.

A faulty phone was found in the shop. What is the probability that it is from supplier B?

  • The phone is known to be faulty: P(F)=0.032\displaystyle {P(F)}={0.032} – the two “faulty” paths.
  • Of them – faulty from supplier B: P(A‾∩F)=0.02\displaystyle {P(\overline{A}\cap F)}={0.02}.
P(A‾/F)=P(A‾∩F)P(F)=0.020.032=0.625P(\overline{A}/F)=\frac{P(\overline{A}\cap F)}{P(F)}=\frac{0.02}{0.032}=0.625

This is the definition of conditional probability, and no new formula is needed (the calculation is sometimes called Bayes’ formula). Only 40% of the phones are from supplier B, but 62.5% of the faulty phones are.

A medical test for a rare disease

The example below works out how likely it is that a person whose test found a disease is really ill – and the answer is surprising.

0.1% of people have a rare disease.
The test for the disease correctly finds 98% of the ill: for them the result is positive.
It correctly finds 96% of the healthy: for 4% of the healthy the result is positive by mistake.
A person chosen at random got a positive result. What is the probability that he is ill?
S\displaystyle S – the person is ill; T\displaystyle T – the result is positive.

  • A positive result, two paths: P(T)=0.001⋅0.98+0.999⋅0.04=0.00098+0.03996=0.04094\displaystyle {P(T)}={0.001\cdot0.98+0.999\cdot0.04}={0.00098+0.03996}={0.04094}.
  • Ill and a positive result: 0.00098\displaystyle 0.00098.
P(S/T)=0.000980.04094≈0.024P(S/T)=\frac{0.00098}{0.04094}\approx0.024

Only about 2.4% of those with a positive result are ill, although the test is right for 98% of the ill.

The base rate in a population

The answer is so small because the healthy are very many. In a hundred thousand people:

  • 100 are ill, and 98 of them get a positive result;
  • 99,900 are healthy, and 3,996 of them get a positive result by mistake.

Of the 4,094 positive results only 98 belong to ill people. Most positive diagnoses come from the test’s mistakes, not from the disease.

The share of the disease in the population – the base rate – changes the answer a great deal. A person sent for the test because of signs of the disease is not “a person chosen at random”: he belongs to a group where the share of the ill is higher, so for him a positive result weighs more.

Exercise 1

The same test as in the example: it correctly finds 98% of the ill and 96% of the healthy.
This time the test is done in a group of people with signs of the disease, and 50% of them are ill.

a

A person from the group got a positive result. What is the probability that he is ill? Round to two decimal places.

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

    b

    Another group has nobody ill at all. What is the probability that a person from this group who got a positive result is ill? Explain.

    Exercise 2

    In a certain town 0.2% of the residents are criminals, and the rest keep the law.
    4% of the trials of innocent defendants end in a conviction.
    20% of the trials of criminals end in an acquittal.
    A resident of the town is put on trial.
    Complete the probabilities in the tree.

    a

    What is the probability that the resident is convicted?

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

      b

      The resident was convicted. What is the probability that he really is a criminal? Round to three decimal places.

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

        c

        In another town all the trials of criminals end in a conviction, and the other data are the same. A resident was convicted. What is the probability that he is a criminal? Round to three decimal places.

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

          Exercise 3

          At a school 50% of the students come by bus, 30% on foot and 20% by bicycle.
          One morning 10% of those who came by bus were late, 5% of those who came on foot and 2% of those who came by bicycle.
          A student is chosen at random. Complete the probability of each rectangle in the area model.

          a

          What is the probability that the student was late?

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

            b

            The student is known to have been late. What is the probability that he came by bus? Round to two decimal places.

              / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

              / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power