Bayes' Rule for events exercise: what is the probability that vampires exist?

199 Views Asked by At

It's an exercise from the online book Bayes Rules! An Introduction to Bayesian Modeling with R. Thus the book has no chapter with the right answers and so far I've not found a designated place to discuss its exercises, let's do the discussion here:)

Exercise 2.4 (Vampires?) Edward is trying to prove to Bella that vampires exist. Bella thinks there is a 0.05 probability that vampires exist. She also believes that the probability that someone can sparkle like a diamond if vampires exist is 0.7, and the probability that someone can sparkle like a diamond if vampires don’t exist is 0.03. Edward then goes into a meadow and shows Bella that he can sparkle like a diamond. Given that Edward sparkled like a diamond, what is the probability that vampires exist?

Letting B denote the event that vampires exist and $B^c$ denote the event that vampires doesn't exist, we have $$P(B)=0.05$$ and $$P(B^c)=1-P(B)=0.95$$

Letting A denote the event that someone can sparkle like a diamond, we also have $$L(B|A)=P(A|B)=0.7$$ and $$L(B^c|A)=P(A|B^c)=0.03$$

According to the Bayes' rule we can calculate the probability that vampires exist given that Edward sparkled like a diamond $$P(B|A)=\frac{P(B)*L(B|A)}{P(A)}$$ P(A) can be calculated by $$P(A)=P(A|B)*P(B)+P(A|B^c)*P(B^c)=0.7*0.05+0.03*0.95=0.0635$$

Thus the answer is $$P(B|A)=\frac{0.05*0.7}{0.0635}=\frac{70}{127}\approx0.55$$