A fellow student tells you they enjoy programming.

How likely is it that they study computer science?

KIT student population

Computer science students
Other students

KIT student population

KIT student population

KIT student population

12.6% × 95% ≈ 12%   vs.   87.4% × 10% ≈ 9%

Under our assumptions, about 58% of students who enjoy programming study computer science.

Your Diseasitis test is positive.

  • 20% of the population has Diseasitis.
  • The test detects Diseasitis 90% of the time.
  • For healthy people, the test is positive 30% of the time.
  • How likely is it that you have Diseasitis?

Your Diseasitis test is positive.

Waterfall diagram

Your smoke alarm starts beeping.

  • How likely is a fire on any given day?
  • How likely is the alarm to beep if there is a fire?
  • How likely is the alarm to beep if there is no fire?
  • How likely is it that there is a fire?

Let's express it as a formula.

$$ P(A \vert B) = \frac{P(B \vert A) \cdot P(A)}{P(B)} $$

Let's express it as a formula.

$$ P(H \vert e) = \frac{P(e \vert H) \cdot P(H)}{P(e)} $$

Let's express it as a formula.

$$ P(H \vert e) = \frac{P(e \vert H) \cdot P(H)} {P(e \vert H) \cdot P(H) + P(e \vert \neg H) \cdot P(\neg H)} $$

Your new computer is loud.

  • 2% of new computers have a broken fan.
  • 80% of computers with a broken fan are loud.
  • 5% of computers with a working fan are loud.
  • How likely is it that your computer has a broken fan?

Your new computer is loud.

broken fan: 2%    working fan: 98%

Your new computer is loud.

2% × 80% = 1.6%   vs.   98% × 5% = 4.9%

Under our assumptions, only about 25% of loud computers have a broken fan.

Your new computer is loud.

$$ P(H \vert e) = \frac{P(e \vert H) \cdot P(H)}{P(e)} $$

Your new computer is loud.

$$ P(\text{broken} \vert \text{loud}) = \frac{P(\text{loud} \vert \text{broken}) \cdot P(\text{broken})} {P(\text{loud})} $$

Your new computer is loud.

$$ P(\text{b} \vert \text{l}) = \frac{P(\text{l} \vert \text{b}) \cdot P(\text{b})} {P(\text{l})} $$

Your new computer is loud.

$$ P(\text{b} \vert \text{l}) = \frac{P(\text{l} \vert \text{b}) \cdot P(\text{b})} {P(\text{l} \vert \text{b}) \cdot P(\text{b}) + P(\text{l} \vert \neg \text{b}) \cdot P(\neg \text{b})} $$

Your new computer is loud.

$$ P(\text{b} \vert \text{l}) = \frac{0.8 \cdot 0.02}{0.8 \cdot 0.02 + 0.05 \cdot 0.98} $$
$$ P(\text{b} \vert \text{l}) = \frac{0.016}{0.016 + 0.049} = \frac{0.016}{0.065} $$
$$ P(\text{broken} \vert \text{loud}) \approx 25\% $$

One more example, this time from fiction.

It introduces a second way to write the formula: odds.

The Death Eaters still bear the Dark Mark.

How likely is it that Voldemort is still alive?

"Suppose the Dark Mark is certain to continue while the Dark Lord's sentience lives on, but a priori we'd only have guessed a twenty percent chance of the Dark Mark continuing to exist after the Dark Lord dies. Then the observation, 'The Dark Mark has not faded' is five times as likely to occur in worlds where the Dark Lord is alive as in worlds where the Dark Lord is dead. Is that really commensurate with the prior improbability of immortality? Let's say the prior odds were a hundred-to-one against the Dark Lord surviving. If a hypothesis is a hundred times as likely to be false versus true, and then you see evidence five times more likely if the hypothesis is true versus false, you should update to believing the hypothesis is twenty times as likely to be false as true."

Expressed as odds.

$$\begin{array}{l r c l} \text{Prior odds} & A & : & B \\ \times \; \text{Likelihood ratio} & a & : & b \\ \hline \text{Posterior odds} & Aa & : & Bb \end{array}$$

Expressed as odds.

$$\begin{array}{l r c l} \text{Prior odds} & 1 & : & 100 \\ \times \; \text{Likelihood ratio} & 100 & : & 20 \\ \hline \text{Posterior odds} & 100 & : & 2000 \end{array}$$

Expressed as odds.

$$\begin{array}{l r c l} \text{Prior odds} & 1 & : & 100 \\ \times \; \text{Likelihood ratio} & 5 & : & 1 \\ \hline \text{Posterior odds} & 1 & : & 20 \end{array}$$

Careful!

  • Garbage in → garbage out
  • 100% and 0% are "sticky" probabilities

What does 100% certain mean?

  • No observation can move you away from 100% or 0% certainty.
  • No observation can bring you to 100% or 0% certainty.
Between 99.999% and 100% certainty lies an infinity of evidence.

Inspired by...