You are driving to Seattle to meet some friends, and want to know whether you should bring an umbrella. You call up 3 of your friends who live there and independently ask them if it’s raining. Your friends like to mess with you, so each of them has a 1/3 chance of lying. If all 3 friends tell you it is raining, what is the probability it is actually raining there?


This question was asked in an actual Facebook data scientist/data analytics interview.

Preparing for a brain teaser interview? Check out our ultimate guide to brain teaser interviews.


Solution

You might fall into the trap of thinking, well if they each have a 1/3 chance of lying and they’re independent, then it’s a 1/27 chance they are all lying or a 26/27 chance it is actually raining. But this line of reasoning is faulty because it does not take into account the actual probability it rains – what if the actual chance of rain in Seattle was 100%? Then it doesn’t matter how likely your friends are to lie about it, it would still be a 100% chance of rain, so this approach is clearly wrong – this is an example of the common Base Rate Fallacy.

In the interview, the right approach would be to say it depends on the actual probability of rain, and ask whether there is a probability you can assume.

If you stick to your basic knowledge of Bayesian probability, you can’t go wrong. Let’s say the result of a friend saying “yes” is y. Then:

P(rain | {y, y, y}) = P(rain AND {y, y, y}) / P({y, y, y})

= P(rain) * P({y, y, y} | rain) / ( P(rain) * P({y, y, y} | rain) + P(no rain) * P({y, y, y} | no rain) )

= P(rain) * (2/3)^3 / ( P(rain) * (2/3)^3 + P(no rain) * (1/3)^3 )

= P(rain) / ( P(rain) + P(no rain) / 8 )

So let’s say the actual probability of rain in Seattle is 25%. Then the probability it is raining if all 3 friends say so is 0.25 / (0.25 + 0.75/8) = 8/11, or roughly 73%.

2 Comments

  1. There’s a 1/3 chance all three of your friends are lying, so there’s a 2/3 chance they’re telling you the truth. Therefore, it’s most likely 1 of your friends is lying, while 2 of your friends are telling the truth. If I were you, I would take along an umbrella.

    • Additionally, I would like to provide a more statistical answer. According to probability theory, the probability of three independent events occurring is derived by multiplying the probability of each of the three independent event: 1/3 × 1/3 × 1/3 = 1/3. So, the chance of your 3 friends lying is 1/3, and the complement of your 3 friends lying is 2/3 (telling the truth).

      If P = 3 Friends Lying, then Pᶜ = 1 – P.

      P = 1/3

      Therefore, Pᶜ = 1 – 1/3 = 2/3.

Leave a Reply

Your email address will not be published. Required fields are marked *