# Bayes' rule

### Bayes' rule

#### Lessons

Recall:
• Multiplication Rule: $P(A \;and\;B)=P(B) \cdot P(A|B)$
• Conditional Probability: $P(B|A)$ $=$ $\frac{P(A \;and\; B)}{P(A)}$
• Law of Total Probability: $P(A)=P(B_1)P(A|B_1)+P(B_2)P(A|B_2)+ \cdots+P(B_n)P(A|B_n)$

Combining all these equations we get Bayes’ Rule:
$P(B|A)$ $=$ $\frac{P(A \;and\; B)}{P(A)}= \frac{P(B) \cdot P(A|B)}{P(A)}$
$=\frac{P(B) \cdot P(A|B)}{P(B_1)P(A|B_1)+P(B_2)P(A|B_2)+ \cdots+P(B_n)P(A|B_n)}$
• Introduction
Deriving Bayes’ rule

• 1.
Bayes' Rule
I am going to ask my boss to be my reference after applying to another job. If she gives me a good recommendation there is a 0.75 probability that I will get the job. While if she gives me a bad recommendation there is only a 0.25 probability that I will get the job. There is a 60% chance she will give me a good reference and a 40% chance she will give me a bad reference.
a)
What is the probability that I will get the job?

b)
Given that I got the job what is the probability that she gave me a good reference

• 2.
I have 3 bags that each contains 5 marbles.
 Bag A: Bag B: Bag C: 2 Green 4 Green 5 Green 3 Red 1 Red 0 Red

I roll a fair die to decide which bag I will draw from. If I roll a 1,2,3 I will draw a marble from Bag A. If I roll a 4,5 I will draw from Bag B. And if I roll a 6, then I will draw a marble from bag C.
a)
What is the probability that I draw a red marble?

b)
Suppose that I drew a green marble from a bag. What is the probability that I rolled a 6?

• 3.
False Positives
A blood test is 95% effective when diagnosing a diseased person. However this blood test also incorrectly diagnoses a healthy person 5% of the time. If 0.1% of the population actually has this disease, then what is the probability that a person has the disease given that they tested positive?

I like this, gives you hope if you get diagnosed for a serious disease
Make note of how many healthy people and how many diseased people get diagnosed. Also make a tree diagram illustrating this.