ViewWiki

Answer key · Unit 17

Conditional probability.

Each lesson’s practice questions, their correct answers and the mistakes they spot. Answers read off the Scene use the same setting the learner sees.

Lesson 1 of 4 · About 25 minutes

Given that

What information does to a chance: count again inside the event you know happened, $P(A \mid B)$ against $P(B \mid A)$, independent events, and why mutually exclusive events are not independent.

Open the lesson

The 5 steps and their answers
  1. Step 1 of 5

    Open this step

    Counting inside the condition

    Practice · Calculate

    Question

    Two dice are rolled, and someone peeks and says: “The first die shows 66⁠”. What is the chance the total is 1010⁠ or more? Give it as a per cent, the number only.

    Correct answer

    50 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    Total
    10fixed
    First die
    6fixed
    All outcomes / The events counted
    The events counted
    Other settings
    Event/nodes/board/props/event = "sumAtLeast"
    Other settings
    Event2/nodes/board/props/event2 = "firstIs"
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    Grid: P(A | B), cells in both ÷ cells in the second event (NaN when it has none)/nodes/board/outputs/aGivenB

    Wrong answers it recognises

    Feedback for a right answer

    Of the 66⁠ squares where the first die is 66⁠, three have a total of 1010⁠ or more: (6,4)(6,4)⁠, (6,5)(6,5)⁠, (6,6)(6,6)⁠. 36=50%\frac{3}{6} = 50\%⁠, three times the 636\frac{6}{36}⁠ without the information.

    Feedback for a wrong answer

    The information crosses out every square where the first die is not 66⁠. Divide only by what is left.

    Hint

    Count only inside the pink squares: of those, how many are also blue?

    Worked solution

    Write SS⁠ for the total and FF⁠ for what the first die shows.

    1. The condition: the first die is 66⁠. That leaves 66⁠ squares, the pink ones.
    2. Of those, in both (amber): (6,4)(6,4)⁠, (6,5)(6,5)⁠, (6,6)(6,6)⁠, which makes 33⁠.
    3. P(S≥10∣F=6)=36=50%P(S \ge 10 \mid F = 6) = \frac{3}{6} = 50\%⁠.

    If you answered about 8.38.3⁠, you divided by 3636⁠: that is the chance that the first is 66⁠ and the total is 1010⁠ or more. If you answered about 16.716.7⁠, you ignored the information: that is the chance of 1010⁠ or more knowing nothing.

  2. Step 2 of 5

    Open this step

    The other way round

    Practice · Calculate

    Question

    Now the other way round: someone says only “the total is 1111⁠ or more”. What is the chance the first die shows 66⁠? Give it as a per cent, the number only.

    Correct answer

    66.67 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    Total
    11fixed
    First die
    6fixed
    All outcomes / The events counted
    The events counted
    Other settings
    Event/nodes/board/props/event = "sumAtLeast"
    Other settings
    Event2/nodes/board/props/event2 = "firstIs"
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    Grid: P(B | A), cells in both ÷ cells in the first event (NaN when it has none)/nodes/board/outputs/bGivenA

    Wrong answers it recognises

    • 33.33 ± 0.5

      Misconception: Treats the chance of A given B as the chance of B given A.

      Feedback from the catalogue

      P(A∣B)P(A \mid B)⁠ and P(B∣A)P(B \mid A)⁠ share a numerator, the outcomes in both events, but their denominators differ: once all the outcomes in BB⁠, once all the outcomes in AA⁠. They are equal only when AA⁠ and BB⁠ are the same size. “Most ill people test positive” is not “most people who test positive are ill”, and mixing them up is called the prosecutor’s fallacy.

    • 5.556 ± 0.5

      Misconception: Confuses the chance of A and B with the chance of A given B: divides by all the outcomes instead of by the outcomes in B, or the reverse.

      Feedback from the catalogue

      “AA⁠ and BB⁠” and “AA⁠ given BB⁠” count the same outcomes, those in both events, but divide by different things. For “and” you divide by all the outcomes. For “given BB⁠” you already know BB⁠ happened, so you divide only by the outcomes in BB⁠: P(A∣B)=P(A∩B)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}⁠. The condition shrinks the denominator, so the conditional chance is the larger one.

    • 16.67 ± 0.5

      Misconception: Answers with the plain chance of A when asked for the chance of A given B, as if the condition told you nothing.

      Feedback from the catalogue

      The condition is new information, and you have to use it. “Given BB⁠” says: cross out every outcome not in BB⁠, and count again inside what is left. Sometimes the chance comes out the same, and then the events are independent, but you find that out only after counting.

    Feedback for a right answer

    There are 33⁠ squares with a total of 1111⁠ or more, and in two of them the first die is 66⁠: 23≈66.7%\frac{2}{3} \approx 66.7\%⁠. The same numerator as the reverse chance, a total of 1111⁠ or more given the first is 66⁠, which is 26\frac{2}{6}⁠, a different denominator.

    Hint

    This time the condition is the blue event. How many blue squares are there, and how many are also pink?

    Worked solution

    Write SS⁠ for the total and FF⁠ for what the first die shows.

    1. The condition: a total of 1111⁠ or more. The squares: (5,6)(5,6)⁠, (6,5)(6,5)⁠, (6,6)(6,6)⁠, which makes 33⁠.
    2. Of those, the first die is 66⁠ in (6,5)(6,5)⁠ and (6,6)(6,6)⁠, which makes 22⁠.
    3. P(F=6∣S≥11)=23≈66.7%P(F = 6 \mid S \ge 11) = \frac{2}{3} \approx 66.7\%⁠.

    If you answered about 33.333.3⁠, you swapped the condition: 26\frac{2}{6}⁠ is the chance of 1111⁠ or more given that the first is 66⁠. The two chances differ because the events differ in size, 33⁠ squares against 66⁠.

  3. Step 3 of 5

    Open this step

    News that changes nothing

    Practice · Predict, then look

    Question

    With no information, the chance of a total of 77⁠ is 636=16\frac{6}{36} = \frac{1}{6}⁠. Now you learn the first die shows 66⁠. What is the chance of a total of 77⁠ now?

    Correct answer

    • Correct Still 16\frac{1}{6}⁠

    Setup, choices and feedback

    The Scene at this step

    Total
    7fixed
    First die
    6fixed
    All outcomes / The events counted
    All outcomesfixed
    Other settings
    Event/nodes/board/props/event = "sum"
    Other settings
    Event2/nodes/board/props/event2 = "firstIs"

    Choices

    • Correct Still 16\frac{1}{6}⁠

    • Wrong More than 16\frac{1}{6}⁠, since 66⁠ is most of the way to 77⁠

      Misconception: Assumes that learning one event happened must change the chance of the other.

      Feedback from the catalogue

      Sometimes the information does not help. When the first die shows 66⁠, the second still has six possibilities, and exactly one of them, 11⁠, makes a total of 77⁠: the chance stays 16\frac{1}{6}⁠, just as without the information. Events like these are called independent: P(A∣B)=P(A)P(A \mid B) = P(A)⁠, or equivalently P(A∩B)=P(A)⋅P(B)P(A \cap B) = P(A) \cdot P(B)⁠.

    • Wrong Less than 16\frac{1}{6}⁠, since only one way is left

      Misconception: Assumes that learning one event happened must change the chance of the other.

      Feedback from the catalogue

      Sometimes the information does not help. When the first die shows 66⁠, the second still has six possibilities, and exactly one of them, 11⁠, makes a total of 77⁠: the chance stays 16\frac{1}{6}⁠, just as without the information. Events like these are called independent: P(A∣B)=P(A)P(A \mid B) = P(A)⁠, or equivalently P(A∩B)=P(A)⋅P(B)P(A \cap B) = P(A) \cdot P(B)⁠.

    Once the prediction is locked in, the Scene changes

    All outcomes / The events counted
    The events countedfixed

    The Scene then shows: 0.1667 · Grid: P(A | B), cells in both ÷ cells in the second event (NaN when it has none)/nodes/board/outputs/aGivenB

    A prediction is never marked as a failure: the learner sees the outcome and the explanation either way.

    Feedback for a right answer

    Only one square is left, (6,1)(6,1)⁠, but only 66⁠ squares are left too: 16\frac{1}{6}⁠, as before. The information changed nothing, so “a total of 77⁠” and “the first is 66⁠” are independent.

    Hint

    If the first is 66⁠, what does the second need to be? And what is the chance of that?

    Worked solution

    Write SS⁠ for the total and FF⁠ for what the first die shows.

    1. Given that the first is 66⁠, 66⁠ squares are left: (6,1)(6,1)⁠ to (6,6)(6,6)⁠.
    2. Only (6,1)(6,1)⁠ gives a total of 77⁠.
    3. P(S=7∣F=6)=16=P(S=7)P(S = 7 \mid F = 6) = \frac{1}{6} = P(S = 7)⁠.

    This holds for every face of the first die: each has exactly one face on the second that makes 77⁠. It fails for a total of 88⁠: if the first is 11⁠, there is no way at all.

  4. Step 4 of 5

    Open this step

    The independent total

    Practice · Reach the target

    Question

    The pink event, BB⁠, is “the first is 66⁠”. Change Total until the blue event, AA⁠, “the total is this one”, is independent of BB⁠: P(A∩B)=P(A)⋅P(B)P(A \cap B) = P(A) \cdot P(B)⁠. Then press Check.

    Goal

    • 1 ± 0.01

      At the start of the step: 0

    Setup, choices and feedback

    The Scene at this step

    Total
    8
    First die
    6fixed
    All outcomes / The events counted
    The events counted
    Other settings
    Event/nodes/board/props/event = "sum"
    Other settings
    Event2/nodes/board/props/event2 = "firstIs"
    Read from the Scene at
    Grid: 1 when P(A and B) = P(A) × P(B), else 0 (events that are certain or impossible count as independent)/nodes/board/outputs/independent

    One setting that reaches it

    Total
    7

    Feedback for a right answer

    Only a total of 77⁠: it has 66⁠ squares, 636⋅636=136\frac{6}{36} \cdot \frac{6}{36} = \frac{1}{36}⁠, exactly the amber square (6,1)(6,1)⁠.

    Feedback for a wrong answer

    Not yet. Check: is the number of amber squares over 3636⁠ equal to the product of the two chances?

    Hint

    P(B)=16P(B) = \frac{1}{6}⁠. Any total has at most one amber square. How many blue squares make 136=P(A)⋅16\frac{1}{36} = P(A) \cdot \frac{1}{6}⁠?

    Worked solution

    1. “The first is 66⁠” covers 66⁠ squares: P=16P = \frac{1}{6}⁠.
    2. A total ss⁠ from 77⁠ to 1212⁠ meets that column in one square, (6,s−6)(6, s - 6)⁠, and a total below 77⁠ does not meet it at all.
    3. You need 136=P(s)⋅16\frac{1}{36} = P(s) \cdot \frac{1}{6}⁠, so P(s)=16P(s) = \frac{1}{6}⁠: 66⁠ squares. Only a total of 77⁠ has six.
    4. Set Total to 77⁠.

    For a total of 88⁠, say: 136≠536⋅16\frac{1}{36} \ne \frac{5}{36} \cdot \frac{1}{6}⁠. Knowing the first is 66⁠ raises the chance of 88⁠ from 536\frac{5}{36}⁠ to 16\frac{1}{6}⁠.

  5. Step 5 of 5

    Open this step

    Cannot happen together

    Practice · Choose

    Question

    The events “a total of 22⁠” and “the first is 66⁠” cannot happen on the same roll: there is no amber square on the board. Are they independent?

    Correct answer

    • Correct No: if one happened, the other certainly did not

    Setup, choices and feedback

    The Scene at this step

    Total
    2fixed
    First die
    6fixed
    All outcomes / The events counted
    The events counted
    Other settings
    Event/nodes/board/props/event = "sum"
    Other settings
    Event2/nodes/board/props/event2 = "firstIs"

    Choices

    Shown in a random order.

    • Correct No: if one happened, the other certainly did not

    • Wrong Yes: they have nothing to do with each other

      Misconception: Thinks events that cannot happen together are independent.

      Feedback from the catalogue

      Mutually exclusive events, which cannot happen together, are the very opposite of independent: if one happened, you know for certain the other did not. Independent means knowing one does not change the chance of the other, so they must be able to happen together: P(A∩B)=P(A)⋅P(B)>0P(A \cap B) = P(A) \cdot P(B) > 0⁠.

    • Wrong You cannot tell without rolling

      Feedback

      You can tell from counting: P(A∩B)=0P(A \cap B) = 0⁠, but P(A)⋅P(B)=136⋅16>0P(A) \cdot P(B) = \frac{1}{36} \cdot \frac{1}{6} > 0⁠.

    Feedback for a right answer

    Given the first is 66⁠, the chance of a total of 22⁠ drops from 136\frac{1}{36}⁠ to 00⁠. Mutually exclusive events are strongly dependent: each rules out the other.

    Hint

    If you know the first die shows 66⁠, what is the chance of a total of 22⁠?

    Worked solution

    Write AA⁠ for “a total of 22⁠” and BB⁠ for “the first is 66⁠”.

    1. Independent means P(A∩B)=P(A)⋅P(B)P(A \cap B) = P(A) \cdot P(B)⁠.
    2. Here P(A∩B)=0P(A \cap B) = 0⁠: no square has both a total of 22⁠ and a first 66⁠.
    3. But P(A)⋅P(B)=136⋅16≠0P(A) \cdot P(B) = \frac{1}{36} \cdot \frac{1}{6} \ne 0⁠.
    4. So they are dependent.

    “Mutually exclusive” is about the squares: no overlap. “Independent” is about the chances: news of one does not change the other.

Lesson 2 of 4 · About 25 minutes

Trees with conditions

A tree with a conditional chance on every branch: split a hall of $1000$ people into ill and healthy, then by test result, multiply along a path, add paths, and draw marbles without putting back.

Open the lesson

The 5 steps and their answers
  1. Step 1 of 5

    Open this step

    Splitting by illness

    Practice · Calculate

    Question

    There are 10001000⁠ people in the hall, and 10%10\%⁠ of them are ill. The test catches 90%90\%⁠ of the ill. How many people are ill and test positive?

    Correct answer

    90 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    10 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Who is ill
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    Positives who are ill/nodes/crowd/outputs/truePositives

    Wrong answers it recognises

    Feedback for a right answer

    1000×0.1=1001000 \times 0.1 = 100⁠ ill, and of those 100×0.9=90100 \times 0.9 = 90⁠ positive. On the tree: the “ill” branch, then the “positive” branch.

    Hint

    First how many are ill, then how many of those the test catches.

    Worked solution

    1. The first branch: 10%10\%⁠ of 10001000⁠ are ill, which is 100100⁠.
    2. The second branch, within the ill: 90%90\%⁠ of 100100⁠ test positive, which is 9090⁠.
    3. Along the path you multiply: 1000×0.1×0.9=901000 \times 0.1 \times 0.9 = 90⁠.

    If you answered 900900⁠, you applied 90%90\%⁠ to the whole hall. But 90%90\%⁠ is a rate for the ill only.

  2. Step 2 of 5

    Open this step

    The other branch

    Practice · Calculate

    Question

    The test clears 90%90\%⁠ of the healthy, and gets 10%10\%⁠ of them wrong. How many healthy people test positive?

    Correct answer

    90 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    10 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Who is ill
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    Positives who are healthy/nodes/crowd/outputs/falsePositives

    Wrong answers it recognises

    Feedback for a right answer

    900900⁠ healthy, and 10%10\%⁠ of them make 9090⁠ false positives: exactly as many as the ill who were caught.

    Hint

    How many healthy people are in the hall?

    Worked solution

    1. The healthy: 1000−100=9001000 - 100 = 900⁠.
    2. Of them, 10%10\%⁠ test positive: 900×0.1=90900 \times 0.1 = 90⁠.

    If you answered 1010⁠, you applied the error rate to the ill (100×0.1100 \times 0.1⁠). If you answered 100100⁠, you applied it to the whole hall.

  3. Step 3 of 5

    Open this step

    Every positive

    Practice · Calculate

    Question

    One person is picked at random from the hall. What is the chance their result is positive? Give it as a per cent, the number only.

    Correct answer

    18 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    10 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Positives sorted
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    People who test positive/nodes/crowd/outputs/positives

    Wrong answers it recognises

    Feedback for a right answer

    90+90=18090 + 90 = 180⁠ positives out of 10001000⁠, which is 18%18\%⁠. This is the law of total probability: add every path that ends in the same result.

    Hint

    Two paths on the tree end in a positive result.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. One path: ill and positive, 0.1×0.9=0.090.1 \times 0.9 = 0.09⁠.
    2. A second path: healthy and positive, 0.9×0.1=0.090.9 \times 0.1 = 0.09⁠.
    3. The paths are mutually exclusive, so you add: P(+)=0.09+0.09=0.18=18%P(+) = 0.09 + 0.09 = 0.18 = 18\%⁠.

    If you answered 99⁠, you counted only the ill who were caught and forgot the false positives.

  4. Step 4 of 5

    Open this step

    Without putting back

    Practice · Calculate

    Question

    A bag holds 55⁠ marbles, 22⁠ of them red. You draw two marbles one after the other, without putting back. What is the chance both are red? Give it as a per cent, the number only.

    Correct answer

    10 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    10 %
    Test accuracy
    90 %
    Retest the positives
    off
    Sort the results
    Positives sorted
    Accepted within
    ± 0.5
    A fixed value in the question

    Wrong answers it recognises

    Feedback for a right answer

    25⋅14=220=10%\frac{2}{5} \cdot \frac{1}{4} = \frac{2}{20} = 10\%⁠. The second branch already knows the first marble was red.

    Hint

    After you draw a red one, how many marbles are left, and how many of them are red?

    Worked solution

    Write R1R_1⁠ and R2R_2⁠ for “the first marble is red” and “the second marble is red”.

    1. The first branch: P(R1)=25P(R_1) = \frac{2}{5}⁠.
    2. The second branch, given the first was red: 44⁠ marbles left and one red, 14\frac{1}{4}⁠.
    3. Along the path you multiply: 25⋅14=110=10%\frac{2}{5} \cdot \frac{1}{4} = \frac{1}{10} = 10\%⁠.

    If you answered 1616⁠, you multiplied 25⋅25\frac{2}{5} \cdot \frac{2}{5}⁠, as if the marble were put back. Without putting back, the second stage depends on the first.

  5. Step 5 of 5

    Open this step

    Along a path

    Practice · Calculate

    Question

    Now 5%5\%⁠ of the hall are ill, and the test is still 90%90\%⁠ accurate. What is the chance that a random person is both ill and positive? Give it as a per cent, the number only.

    Correct answer

    4.5 ± 0.3

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    5 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Who is ill
    Accepted within
    ± 0.3
    Computed from the Scene at this step’s setting
    Positives who are ill/nodes/crowd/outputs/truePositives

    Wrong answers it recognises

    Feedback for a right answer

    0.05×0.9=0.045=4.5%0.05 \times 0.9 = 0.045 = 4.5\%⁠: 4545⁠ out of 10001000⁠. This is the multiplication rule: P(A∩B)=P(A)⋅P(B∣A)P(A \cap B) = P(A) \cdot P(B \mid A)⁠.

    Hint

    Multiply the two branches along the path.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. P(D)=0.05P(D) = 0.05⁠.
    2. P(+∣D)=0.9P(+ \mid D) = 0.9⁠.
    3. P(D∩+)=0.05×0.9=0.045=4.5%P(D \cap +) = 0.05 \times 0.9 = 0.045 = 4.5\%⁠.

    If you answered 9090⁠, you gave P(+∣D)P(+ \mid D)⁠, the chance within the ill. “Both” is a share of the whole hall, so you also multiply by the share who are ill.

Lesson 3 of 4 · About 25 minutes

Base rates

Why a test that is $90\%$ accurate is wrong about most of its positives when the disease is rare: count the false positives, find when a positive is half and half, and see what a better test does and does not do.

Open the lesson

The 5 steps and their answers
  1. Step 1 of 5

    Open this step

    A rare disease

    Practice · Predict, then look

    Question

    A disease affects 1%1\%⁠ of people, and the test is 90%90\%⁠ accurate. Someone has tested positive. What is the chance they are really ill?

    Correct answer

    • Correct About 8%8\%⁠

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    1 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Test resultsfixed

    Choices

    • Correct About 8%8\%⁠

    • Wrong 90%90\%⁠, the same as the accuracy

      Misconception: Takes a test's accuracy as the chance that a positive result is right: 90% accurate, so a positive means 90% ill.

      Feedback from the catalogue

      Write DD⁠ for “ill” and ++⁠ for “positive”. Accuracy says what the test does to the ill and to the healthy: P(+∣D)P(+ \mid D)⁠. The question of someone who tested positive is the reverse: P(D∣+)P(D \mid +)⁠. The answer also depends on how common the disease is. When it is rare, most positives come from the large group of the healthy, so the chance of being ill is far below the accuracy. This is base-rate neglect.

    • Wrong About 50%50\%⁠

      No feedback of its own; the learner sees the standard message

      Not yet. Look again and try once more.

    • Wrong 1%1\%⁠, like anyone else

      Misconception: Answers with the plain chance of A when asked for the chance of A given B, as if the condition told you nothing.

      Feedback from the catalogue

      The condition is new information, and you have to use it. “Given BB⁠” says: cross out every outcome not in BB⁠, and count again inside what is left. Sometimes the chance comes out the same, and then the events are independent, but you find that out only after counting.

    Once the prediction is locked in, the Scene changes

    Sort the results
    Positives sortedfixed

    The Scene then shows: 8.333 · Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    A prediction is never marked as a failure: the learner sees the outcome and the explanation either way.

    Feedback for a right answer

    Only about 8%8\%⁠: 99⁠ ill among 108108⁠ positives. On the right-hand mat stand 9999⁠ healthy people, because 10%10\%⁠ of 990990⁠ healthy is far more than 90%90\%⁠ of 1010⁠ ill.

    Hint

    Count the two groups of positives: ill people caught and healthy people the test got wrong.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. Out of 10001000⁠: 1010⁠ ill and 990990⁠ healthy.
    2. Ill and positive: 10×0.9=910 \times 0.9 = 9⁠.
    3. Healthy and positive: 990×0.1=99990 \times 0.1 = 99⁠.
    4. P(D∣+)=99+99=9108≈8.3%P(D \mid +) = \frac{9}{9 + 99} = \frac{9}{108} \approx 8.3\%⁠.

    If you chose 90%90\%⁠, you mixed up P(+∣D)P(+ \mid D)⁠ with P(D∣+)P(D \mid +)⁠. When the disease is rare, the healthy supply most of the positives.

  2. Step 2 of 5

    Open this step

    Counting false alarms

    Practice · Calculate

    Question

    In the same hall, 1%1\%⁠ ill and a 90%90\%⁠ accurate test: how many of the positives are healthy?

    Correct answer

    99 ± 0.5

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    1 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Positives sorted
    Accepted within
    ± 0.5
    Computed from the Scene at this step’s setting
    Positives who are healthy/nodes/crowd/outputs/falsePositives

    Wrong answers it recognises

    Feedback for a right answer

    990×0.1=99990 \times 0.1 = 99⁠ false positives, eleven times the 99⁠ ill people caught.

    Hint

    How many healthy people are there, and what share does the test flag by mistake?

    Worked solution

    1. The healthy: 1000−10=9901000 - 10 = 990⁠.
    2. The test gets 10%10\%⁠ of them wrong: 990×0.1=99990 \times 0.1 = 99⁠.

    If you answered 11⁠, you applied the error rate to the ill: 11⁠ is the ill person the test missed. If you answered 1010⁠, you applied it to 100100⁠ people instead of to the healthy.

  3. Step 3 of 5

    Open this step

    Half and half

    Practice · Reach the target

    Question

    The test stays 90%90\%⁠ accurate. Change How common the disease is until half the positives are really ill, then press Check.

    Goal

    • 50 ± 1

      At the start of the step: 8.333

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    1 %
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Positives sorted
    Read from the Scene at
    Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    One setting that reaches it

    How common the disease is
    9.7 %

    Feedback for a right answer

    About 10%10\%⁠: 9090⁠ ill positives and 9090⁠ healthy positives. The more common the disease, the more a positive means, with exactly the same test.

    Feedback for a wrong answer

    Not yet. Compare the two mats: when are they the same size?

    Hint

    Half and half means as many ill positives as healthy positives: 0.9p=0.1(1−p)0.9p = 0.1(1 - p)⁠.

    Worked solution

    1. Half the positives are ill when the left and right mats are equal: p×0.9=(1−p)×0.1p \times 0.9 = (1 - p) \times 0.1⁠.
    2. 0.9p=0.1−0.1p0.9p = 0.1 - 0.1p⁠, so p=0.1p = 0.1⁠.
    3. Set How common the disease is to 10%10\%⁠.

    The same test, at 1%1\%⁠, gives only 8%8\%⁠. The base rate matters as much as the test itself.

  4. Step 4 of 5

    Open this step

    A better test

    Practice · Predict, then look

    Question

    Back to 1%1\%⁠ ill. The test is replaced by one that is 99%99\%⁠ accurate. What is the chance now that a positive is ill?

    Correct answer

    • Correct About 50%50\%⁠

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    1 %fixed
    Test accuracy
    90 %fixed
    Retest the positives
    offfixed
    Sort the results
    Test resultsfixed

    Choices

    • Correct About 50%50\%⁠

    • Wrong 99%99\%⁠

      Misconception: Takes a test's accuracy as the chance that a positive result is right: 90% accurate, so a positive means 90% ill.

      Feedback from the catalogue

      Write DD⁠ for “ill” and ++⁠ for “positive”. Accuracy says what the test does to the ill and to the healthy: P(+∣D)P(+ \mid D)⁠. The question of someone who tested positive is the reverse: P(D∣+)P(D \mid +)⁠. The answer also depends on how common the disease is. When it is rare, most positives come from the large group of the healthy, so the chance of being ill is far below the accuracy. This is base-rate neglect.

    • Wrong Still about 9%9\%⁠: the test hardly matters

      Feedback

      The test matters a great deal: its error rate falls tenfold, from 10%10\%⁠ to 1%1\%⁠, and the false positives with it.

    • Wrong About 80%80\%⁠

      No feedback of its own; the learner sees the standard message

      Not yet. Look again and try once more.

    Once the prediction is locked in, the Scene changes

    Test accuracy
    99 %fixed
    Sort the results
    Positives sortedfixed

    The Scene then shows: 50 · Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    A prediction is never marked as a failure: the learner sees the outcome and the explanation either way.

    Feedback for a right answer

    50%50\%⁠: 1010⁠ ill positives and 1010⁠ healthy positives (1%1\%⁠ of 990990⁠). Even an excellent test is still wrong about half its positives when the disease is rare.

    Hint

    How many healthy people get flagged when the error is 1%1\%⁠?

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. Ill positives: 10×0.99≈1010 \times 0.99 \approx 10⁠.
    2. Healthy positives: 990×0.01≈10990 \times 0.01 \approx 10⁠.
    3. P(D∣+)=1020=50%P(D \mid +) = \frac{10}{20} = 50\%⁠.

    For a positive to be nearly certain, the error rate has to be much smaller than the disease’s rate.

  5. Step 5 of 5

    Open this step

    Rarer still

    Practice · Calculate

    Question

    And a rarer disease still, 11⁠ in 10001000⁠ (0.1%0.1\%⁠), with the same 99%99\%⁠ test? What is the chance a positive is ill? Give it as a per cent, the number only, to one decimal place.

    Correct answer

    9.016 ± 0.3

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    0.1 %fixed
    Test accuracy
    99 %fixed
    Retest the positives
    offfixed
    Sort the results
    Test results
    Accepted within
    ± 0.3
    Computed from the Scene at this step’s setting
    Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    Wrong answers it recognises

    Feedback for a right answer

    About 9%9\%⁠: for every ill person caught there are about 1010⁠ false positives. That is why rare diseases are screened for in groups at risk, not in everyone.

    Hint

    Among 10001000⁠ people there is one ill. How many of the 999999⁠ healthy get flagged?

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. As rates: P(D∩+)=0.001×0.99=0.00099P(D \cap +) = 0.001 \times 0.99 = 0.00099⁠.
    2. P(H∩+)=0.999×0.01=0.00999P(H \cap +) = 0.999 \times 0.01 = 0.00999⁠.
    3. P(D∣+)=0.000990.00099+0.00999≈0.090=9.0%P(D \mid +) = \frac{0.00099}{0.00099 + 0.00999} \approx 0.090 = 9.0\%⁠.

    In a hall of 10001000⁠ that is one ill person against about 1010⁠ healthy people on the mats.

Lesson 4 of 4 · About 25 minutes

Bayes' theorem

From counting in the hall to a formula: Bayes' theorem turns the condition round, a retest beats the base rate, what comes out after one piece of evidence is the starting point for the next, and the prosecutor's fallacy.

Open the lesson

The 5 steps and their answers
  1. Step 1 of 5

    Open this step

    The formula

    Practice · Calculate

    Question

    2%2\%⁠ ill, and a 95%95\%⁠ accurate test. By Bayes’ theorem, what is the chance a positive is ill? Give it as a per cent, the number only, to one decimal place.

    Correct answer

    27.94 ± 0.3

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    2 %fixed
    Test accuracy
    95 %fixed
    Retest the positives
    offfixed
    Sort the results
    Test results
    Accepted within
    ± 0.3
    Computed from the Scene at this step’s setting
    Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    Wrong answers it recognises

    Feedback for a right answer

    0.0190.019+0.049≈27.9%\frac{0.019}{0.019 + 0.049} \approx 27.9\%⁠. In the hall: 1919⁠ ill among 6868⁠ positives.

    Hint

    P(+)=0.02×0.95+0.98×0.05P(+) = 0.02 \times 0.95 + 0.98 \times 0.05⁠.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. The numerator: P(+∣D)⋅P(D)=0.95×0.02=0.019P(+ \mid D) \cdot P(D) = 0.95 \times 0.02 = 0.019⁠.
    2. The denominator, all the positives: 0.019+0.05×0.98=0.019+0.049=0.0680.019 + 0.05 \times 0.98 = 0.019 + 0.049 = 0.068⁠.
    3. P(D∣+)=0.0190.068≈0.279=27.9%P(D \mid +) = \frac{0.019}{0.068} \approx 0.279 = 27.9\%⁠.

    If you answered 1.91.9⁠, you stopped at the numerator: that is the chance of being both ill and positive, a share of everyone. Bayes divides it by all the positives.

  2. Step 2 of 5

    Open this step

    Turning the condition round

    Practice · Choose

    Question

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    Which expression equals P(D∣+)P(D \mid +)⁠?

    Correct answer

    • Correct P(+∣D)⋅P(D)P(+)\dfrac{P(+ \mid D) \cdot P(D)}{P(+)}⁠

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    2 %
    Test accuracy
    95 %
    Retest the positives
    off
    Sort the results
    Positives sorted

    Choices

    Shown in a random order.

    • Correct P(+∣D)⋅P(D)P(+)\dfrac{P(+ \mid D) \cdot P(D)}{P(+)}⁠

    • Wrong P(+∣D)P(+ \mid D)⁠

      Misconception: Treats the chance of A given B as the chance of B given A.

      Feedback from the catalogue

      P(A∣B)P(A \mid B)⁠ and P(B∣A)P(B \mid A)⁠ share a numerator, the outcomes in both events, but their denominators differ: once all the outcomes in BB⁠, once all the outcomes in AA⁠. They are equal only when AA⁠ and BB⁠ are the same size. “Most ill people test positive” is not “most people who test positive are ill”, and mixing them up is called the prosecutor’s fallacy.

    • Wrong P(+∣D)⋅P(D)P(+ \mid D) \cdot P(D)⁠

      Misconception: Confuses the chance of A and B with the chance of A given B: divides by all the outcomes instead of by the outcomes in B, or the reverse.

      Feedback from the catalogue

      “AA⁠ and BB⁠” and “AA⁠ given BB⁠” count the same outcomes, those in both events, but divide by different things. For “and” you divide by all the outcomes. For “given BB⁠” you already know BB⁠ happened, so you divide only by the outcomes in BB⁠: P(A∣B)=P(A∩B)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}⁠. The condition shrinks the denominator, so the conditional chance is the larger one.

    • Wrong P(D)P(+∣D)\dfrac{P(D)}{P(+ \mid D)}⁠

      No feedback of its own; the learner sees the standard message

      Not yet. Look again and try once more.

    Feedback for a right answer

    This is Bayes’ theorem: it turns the condition round using P(A∩B)=P(B∣A)⋅P(A)P(A \cap B) = P(B \mid A) \cdot P(A)⁠.

    Hint

    P(A∣B)=P(A∩B)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}⁠, and P(A∩B)P(A \cap B)⁠ can also be written from the other side.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. From the definition: P(D∣+)=P(D∩+)P(+)P(D \mid +) = \frac{P(D \cap +)}{P(+)}⁠.
    2. From the multiplication rule, the other way round: P(D∩+)=P(+∣D)⋅P(D)P(D \cap +) = P(+ \mid D) \cdot P(D)⁠.
    3. Substitute: P(D∣+)=P(+∣D)⋅P(D)P(+)P(D \mid +) = \frac{P(+ \mid D) \cdot P(D)}{P(+)}⁠.

    The expression without the denominator is “both”, not the conditional chance.

  3. Step 3 of 5

    Open this step

    Testing again

    Practice · Calculate

    Question

    Still 2%2\%⁠ ill and a 95%95\%⁠ test, but now everyone who tested positive is tested again, independently, and stays positive only if that test agrees. What is the chance a double positive is ill? Give it as a per cent, the number only.

    Correct answer

    88.05 ± 2

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    2 %fixed
    Test accuracy
    95 %fixed
    Retest the positives
    onfixed
    Sort the results
    Test results
    Accepted within
    ± 2
    Computed from the Scene at this step’s setting
    Per cent chance a positive is ill, by Bayes' rule/nodes/crowd/outputs/posterior

    Wrong answers it recognises

    Feedback for a right answer

    About 88%88\%⁠: of 980980⁠ healthy, only about 22⁠ pass twice, while 1818⁠ of the 2020⁠ ill remain. A retest is the practical way to beat the base rate.

    Hint

    With two tests an ill person stays positive with chance 0.9520.95^2⁠, and a healthy one with chance 0.0520.05^2⁠.

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. Ill and positive twice: 0.02×0.952=0.02×0.9025=0.018050.02 \times 0.95^2 = 0.02 \times 0.9025 = 0.01805⁠.
    2. Healthy and positive twice: 0.98×0.052=0.98×0.0025=0.002450.98 \times 0.05^2 = 0.98 \times 0.0025 = 0.00245⁠.
    3. P(D∣++)=0.018050.01805+0.00245≈0.880=88%P(D \mid {+}{+}) = \frac{0.01805}{0.01805 + 0.00245} \approx 0.880 = 88\%⁠.

    In the hall the counts are rounded: 1818⁠ ill and 22⁠ healthy, which is 90%90\%⁠. The exact sum gives 88%88\%⁠.

  4. Step 4 of 5

    Open this step

    One step at a time

    Practice · Calculate

    Question

    Another way to work out the second test: after the first positive, the chance of being ill is 27.9%27.9\%⁠. Use that as the new base rate, and apply Bayes again with the 95%95\%⁠ test. What comes out? Give it as a per cent, the number only.

    Correct answer

    88 ± 1

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    2 %fixed
    Test accuracy
    95 %fixed
    Retest the positives
    onfixed
    Sort the results
    Positives sorted
    Accepted within
    ± 1
    A fixed value in the question

    Wrong answers it recognises

    Feedback for a right answer

    0.2650.265+0.036≈88%\frac{0.265}{0.265 + 0.036} \approx 88\%⁠, exactly as with the retest. This is how Bayes works: what comes out after one piece of evidence is the starting point for the next.

    Hint

    0.279×0.950.279×0.95+0.721×0.05\frac{0.279 \times 0.95}{0.279 \times 0.95 + 0.721 \times 0.05}⁠

    Worked solution

    Write DD⁠ for the event “ill”, HH⁠ for “healthy” and ++⁠ for “a positive result”.

    1. The new base rate: P(D)=0.279P(D) = 0.279⁠, so P(H)=0.721P(H) = 0.721⁠.
    2. The numerator: 0.279×0.95≈0.2650.279 \times 0.95 \approx 0.265⁠.
    3. The denominator: 0.265+0.721×0.05≈0.265+0.036=0.3010.265 + 0.721 \times 0.05 \approx 0.265 + 0.036 = 0.301⁠.
    4. 0.2650.301≈0.88=88%\frac{0.265}{0.301} \approx 0.88 = 88\%⁠.

    It matches the sum for both tests together, because the tests are independent: it makes no difference whether you update all at once or step by step.

  5. Step 5 of 5

    Open this step

    The prosecutor's fallacy

    Practice · Choose

    Question

    DNA is found at a crime scene. The chance an innocent person matches it by chance is 11⁠ in 10,00010{,}000⁠. The city has 500,000500{,}000⁠ people, and one suspect who matches is found, with no other evidence. The prosecutor says: “The chance he is innocent is 11⁠ in 10,00010{,}000⁠”. What is right?

    Correct answer

    • Correct About 5050⁠ innocent people in the city are expected to match, so without more evidence the chance he is the culprit is about 11⁠ in 5151⁠

    Setup, choices and feedback

    The Scene at this step

    How common the disease is
    2 %
    Test accuracy
    95 %
    Retest the positives
    off
    Sort the results
    Positives sorted

    Choices

    Shown in a random order.

    • Correct About 5050⁠ innocent people in the city are expected to match, so without more evidence the chance he is the culprit is about 11⁠ in 5151⁠

    • Wrong The prosecutor is right: the chance he is innocent is 11⁠ in 10,00010{,}000⁠

      Misconception: Treats the chance of A given B as the chance of B given A.

      Feedback from the catalogue

      P(A∣B)P(A \mid B)⁠ and P(B∣A)P(B \mid A)⁠ share a numerator, the outcomes in both events, but their denominators differ: once all the outcomes in BB⁠, once all the outcomes in AA⁠. They are equal only when AA⁠ and BB⁠ are the same size. “Most ill people test positive” is not “most people who test positive are ill”, and mixing them up is called the prosecutor’s fallacy.

    • Wrong Half and half: he is guilty or he is not

      Feedback

      Two possibilities are not equally likely. Count: how many people in the city match?

    Feedback for a right answer

    500,00010,000=50\frac{500{,}000}{10{,}000} = 50⁠ chance matches, plus the culprit himself. The match narrows the suspects from half a million to 5151⁠, but not to one.

    Hint

    How many of the 500,000500{,}000⁠ residents would match by chance?

    Worked solution

    Write MM⁠ for “matches the DNA”, II⁠ for “innocent” and GG⁠ for “guilty”.

    1. 110,000\frac{1}{10{,}000}⁠ is P(M∣I)P(M \mid I)⁠.
    2. The question is P(I∣M)P(I \mid M)⁠: the condition the other way round.
    3. Count: of 500,000500{,}000⁠ innocent people, about 5050⁠ match. Plus the culprit, one. So 5151⁠ match.
    4. Without other evidence, P(G∣M)≈151P(G \mid M) \approx \frac{1}{51}⁠.

    This is the prosecutor’s fallacy: turning the condition round, like mixing up a test’s accuracy with the chance a positive is ill.

Across the unit · 9 misconceptions

Misconception catalogue

Each common mistake this unit recognises, in a few words. Open one for what the learner reads when an answer matches it, and where it is asked.

Index