Let's say I'm trying to find out the probability that someone's favorite ice cream flavor is vanilla.
I know that the person also enjoys horror movies.
I want to find out the probability that the person's favorite ice cream is vanilla given that they enjoy horror movies.
I know the following things:
- $5\%$ of people choose vanilla as their favorite ice cream flavor. ( This is my $P(A)$ )
- $10\%$ of people whose favorite is vanilla ice cream also love horror movies. ( This is my $P(B|A)$ )
- $1\%$ of people whose favorite is not vanilla ice cream also love horror movies ( This is my $P(B|\lnot A)$ )
So, I calculate it like this: $$P(A|B)=\frac{0.05\times0.1}{(0.05 \times 0.1)+(0.01 \times(1-0.05))}$$ I find that $P(A|B) = 0.3448$ (rounded to the nearest ten-thousandth). There is a $34.48\%$ chance that a horror movie fan's favorite ice cream flavor is vanilla.
But then I learn that the person has seen a horror movie in the past 30 days. Here's what I know:
- $34.48\%$ is the updated posterior probability that vanilla is the person's favorite ice cream flavor -- the $P(A)$ in this next problem.
- $20\%$ of people whose favorite is vanilla ice cream have seen a horror movie in the past 30 days.
- $5\%$ of people whose favorite is not vanilla ice cream have seen a horror movie in the past 30 days.
This gives: $$\frac{0.3448\times0.2}{(0.3448\times0.2)+(0.05\times(1-0.3448))} = 0.6779$$ when rounded.
So now I believe there is a $67.79\%$ chance that the horror movie fan loves ice cream given that they've seen a horror movie in the past 30 days.
But wait, there is another thing. I also learned that the person owns a cat.
Here's what I know:
- $67.79\%$ is the updated posterior probability that vanilla is the person's favorite ice cream flavor -- the $P(A)$ in this next problem
- $40\%$ of people whose favorite is vanilla ice cream also own cats
- $10\%$ of people whose favorite is not vanilla ice cream also own cats
This gives: $$\frac{0.6779\times0.4}{(0.6779\times 0.4)+(0.1\times(1-0.6779))} = 0.8938$$ when rounded.
My question basically boils down to this: Am I correctly updating probability using Bayes' theorem? Am I getting anything else wrong in my methods?