Bayes Rule

In this section we’re going to learn about Bayes Rule, which was named after Reverend Thomas Bayes, apparently.

There are two videos for this section. The first introduces Bayes’ Rule, the second is a worked example.

Twenty five-minute video

You can also view this video on YouTube

Ten-minute example

You can also view this video on YouTube


Key Points

Bayes’ rule uses conditional probabilities to find the probability of A given B when we know \( P(B|A) \), but don’t know \( P(A \cap B ) \).

\( P(A|B) = \frac{ P(B|A) \times P(A) }{P(B)} \)

This is a rearragement of the formula for conditional probability \( P(A \cap B) = P(A|B) \times P(B) \)

Applying Bayes’ Rule

Question: What is the liklihood that a student who passed their exam had revised? Assuming:

  • Half of students revise
  • Half of students pass their exam
  • Of those who revise, 80% passed their exam

Answer: We can use Bayes’s Rule to solve this question.

  • \(P(Revise) = 0.5 \)
  • \(P(Pass) = 0.5 \)
  • \(P(Pass | Revise) = 0.8 \)

\[ \frac{ P(Pass|Revise) \times P(Revise)}{P(Pass)} = \frac{ 0.8 \times 0.5}{0.5} = 0.8\]

Therefore \( P(Revise|Pass) = 0.8 \)

Thinking like a Bayesian

We can use Bayes’ rule to iteratively update our beliefs about the world. This is one of the techniques used in machine learning.

We have a hypothesis H and new evidence E.

  • Our prior probability (\( P(H) \)) is how likely we think H is before our new evidence.
  • We want to work out the posterior probability (\( P(H | E) \)) of our hypothesis after the new evidence

We also need to know:

  • the probability that our evidence itself is true (\( P(E) \) )
  • how likely the evidence is if our hypothesis is true (\( P(E|H) \))

Using Bayes rule we can find our posterior: \(P(H|E)= \frac{ P(E|H) \times P(H)}{P(E)} \)

We often want to make use of the Law of Total Probability

\[ P(H_1|E)= \frac{ P(E|H_1) \times P(H_1)}{\sum_{i} P(E | H_i) \times P(H_i)} \]


Questions

1. Question Generator

Show Answer
Simple
Complex


Summary

In this section we have learned about Bayes Rule.

You can now move on to the probability challenges.