Shawn Lin

Probability Pattern - Bayes Rule


Bayes Rule

Bayes rule is a very common probability question pattern. It usually involves using the Bayes rule, together with the law of total probability, to compute some conditional probability. When you seen in the question statement, “given” a conditional, what is the probability of an event happening, you should think of using Bayes rule.


Bayes rule

Law of total probability


Unfair Coin

Green Book

You are given 1000 coins. Among the, 1 coin has heads on both sides. The other 999 coins are fair coins. You randomly choose a coin and toss it 10 times. Each time, the coin turns up heads. What is the probability that the coin you choose is the unfair one?

  1. Using Bayes rule, we have:

  2. Now, using the law of total probability, we have:

  3. Combining both, we have our equation as:

Disease Odds

DS Book

One in a thousand people have a particular disease, and the test for the disease is 98% correct in testing for the disease. On the other hand, the test has 1% error rate if the person being tested does not have the disease. If someone tests positive, what are the odds they have the disease?

Rainy Day

DS Book

Three friends in Seattle each told you it is rainy, and each person has 1/3 probability of lying. What is the probability that Seattle is rainy, assuming that the likelihood of rain on any given day is 0.25?

Diligent Rater

DS Book

Facebook has a content team that labels pieces of content on the platform as either spam or not spam. 90% of them are diligent raters and will mark 20% of the content as spam and 80% as non-spam. The remaining 10% are not diligent raters and will mark 0% of the content as spam and 100% as non-spam. Assume the pieces of content are labeled independently of one another, for every rater. Given that a rater has labeled four pieces of content as good, what is the probability that this rater is a diligent rater?

Letter in Drawer

DS Book

A desk has either drawers. There is a probability of 1/2 that someone placed a letter in one of the desk’s either drawers and a probability of 1/2 that this person did not place a letter in any of the desk’s either drawers. You open the first 7 drawers and find that they are all empty. What is the probability that the 8th drawer has a letter in it?