An Application of Bayes' Rule

59 Views Asked by At

I am working on the following problem:

A school serves orange juice on Thursdays and milk every other day. It is warm outside 70% of the time, Harry is only happy when orange juice is served or it is warm outside. Harry is happy today. What is the probability today is a warm Thursday?

I think this might be an application of Bayes' theorem? (I could be wrong) But I cannot get beyond formulating the following: $$P(\text{Warm Thursday} | \text{Happy}) = \frac{P(\text{Happy} | \text{Warm Thursday})P(\text{Warm Thursday})}{P(\text{Happy})}$$

I believe $P(Warm) = 0.7$ but I don't know where to go from here working out the rest, any help would be great, thanks.

2

There are 2 best solutions below

0
On

I'm assuming that we're talking about the whole week (7 days), not the school week (5 days). Assuming independence: $$P(\text{Warm Thursday}) = P(\text{Warm}) \times P(\text{Thursday}) = 7/10 \times 1/7 = 0.1$$ Then, assuming Harry is always happy when it's warm: $$P(\text{Happy} | \text{Warm Thursday}) = 1$$ Finally, what's the prior probability of him being happy? Use marginalization $$P(\text{Happy}) = P(\text{Happy on Monday}) + P(\text{Happy on Tuesday}) \ + \ ...= 1/7 + 6 \times 1/7 \times 0.7$$

Note that the probability of being happy on Thursday is the probability of Thursday itself since we know he's happy on Thursday.

Use Bayes Rule to combine the results.

0
On

Alternatively, you can do it this way. Being happy is the same as either warm or Thursday. It implies the probability of being happy is given by

$$\operatorname{Pr}( \text{Happy}) = \operatorname{Pr}( \text{Warm} \cup \text{Thursday})$$

Then we can use the inclusion-exclusion principle

$$\operatorname{Pr}( \text{Warm} \cup \text{Thursday}) = \operatorname{Pr}( \text{Warm}) + \operatorname{Pr}( \text{Thursday} ) - \operatorname{Pr}( \text{Warm} \cap \text{Thursday})$$

We know that $\operatorname{Pr}( \text{Warm} \cap \text{Thursday}) = 70\% \times \frac{1}{7} = 10\%$.

Then

$$\operatorname{Pr}( \text{Happy}) = 70\% + \frac{1}{7} - 10\%$$

You can finish the rest, as the other two quantities in the Bayes' rule formula are given by Tomasz Bartkowiak. The answer is the same as the answer given by Tomasz. I'm just computing the denominator in the Bayes' rule formula in a different way.