17
$\begingroup$

Out of curiosity, here's a question from Glassdoor (Facebook Data Science Interview)

You're about to get on a plane to Seattle. You want to know if you should bring an umbrella. You call 3 random friends of yours who live there and ask each independently if it's raining. Each of your friends has a 2/3 chance of telling you the truth and a 1/3 chance of messing with you by lying. All 3 friends tell you that "Yes" it is raining. What is the probability that it's actually raining in Seattle?

Using Bayesian analysis, it's pretty clear that you cannot solve this without the prior probability of raining in Seattle.

However, here's a different approach which I found interesting in the discussion contained in Glassdoor.

Since all three friends said "Yes", the question basically boils down to what is the probability that all three friends are telling the truth given that all three friends said "Yes". Since you ask all three friends independently, the probability that all three friends are telling the truth is given by (2/3)(2/3)(2/3) = 8/27. Thus, the probability of it raining is 8/27.

While this is perhaps a bit compelling, I'm not sure if it's correct. Anyone have any ideas?

Thanks!

$\endgroup$

migrated from mathoverflow.net Jun 22 '15 at 18:20

This question came from our site for professional mathematicians.

  • 2
    $\begingroup$ An estimate for the prior probabillity of rain can be found by simply googling 'number of rainy days in seattle' which shows that approx. 150 days of the year has rain so a reasonable number to use is $p_{\rm rain} \approx 0.4$. $\endgroup$ – Winther Oct 27 '15 at 2:01
9
$\begingroup$

To put it a bit more formally... Let $p_r$ be the prior probability for rain ($p_n\equiv 1-p_r$). Then the probability of rain given 3 "yes" replies $\{y,y,y\}$ is

$$ \mathsf{P}(\text{rain}\mid \{y,y,y\})=\frac{\mathsf{P}(\text{rain}\cap\{y,y,y\})}{\mathsf{P}(\{y,y,y\})} \\ =\frac{\mathsf{P}(\{y,y,y\}\mid\text{rain})\cdot p_r}{\mathsf{P}(\{y,y,y\}\mid\text{rain})\cdot p_r+\mathsf{P}(\{y,y,y\}\mid\text{no rain})\cdot p_n} $$

Next, if we assume conditional independence of friends' replies, the last formula becomes

$$ =\frac{(2/3)^3\cdot p_r}{(2/3)^3\cdot p_r+(1/3)^3\cdot p_n}=\frac{p_r}{p_r+ p_n/8}. $$

$\endgroup$
4
$\begingroup$

Your arithmetic is wrong, but that's not the worst problem with your method.

Would you apply the same logic if the question was "are there two blue moons in the sky"?

$\endgroup$
4
$\begingroup$

** Edited **

Assuming prior possibility of raining on any day is 0.25, P(raining given all three say yes) can be calculated using Bayes theorem

i.e. P(R|YYY) = P(R)*P(YYY|R)/P(YYY)

P(YYY) = all tell truth when raining + all lie when not raining = 0.25 * (2/3)^3 + 0.75 * (1/3)^3

P(R|YYY) = 0.25 * (2/3)^3 / (0.25 * (2/3)^3 + 0.75 * (1/3)^3) = 8 / (8 + 3) = 8/11

$\endgroup$
3
$\begingroup$

Each of the above analyses fail to assess the logic of the question primarily in their approach. Since all three say it is raining, you cannot approach the solution by determining each friend's propensity for truth. For it not to be raining, they ALL must be lying. Therefore, the solution must be the inverse of the probability that all three are "messing with you." (1/3)x(1/3)x(1/3)=1/27 (3.7% chance they are all lying). Since there is only a 3.7% chance all three friends are messing with you, there is a 96.3% chance it is raining.

$\endgroup$
1
$\begingroup$

You are completely right about Bayesian analysis. It is indeed correct to say that the probability is 8/27 (not 8/9) that they all tell the truth, prior to the experiment. However, post the experiment, you have three answers. If in the area it is unlikely to rain (for interest in the desert), the three 'yes' answers are proof to two things: a) it might indeed be raining b) they are lying.

So, after the experiment, the probability is not 8/27 that are telling the truth, because the answers they give are proof of their honesty.

There is some calculations tricks not many people know. The 2/3 you can see as a prior probability change of 1/2 going to 2/3, even if the prior probability is not 1/2. Now, if you take the "Odd", which is $p / (1-p)$, then you can just simply multiply them. $Odd(2/3) = 2$. If your prior probability is $1/10$, then the $Odd(1/10) = 1/9$. For three time yes, you multiply it with 2 for three times. You get 8/9. Back to normal probability, you get $8/17$.

$\endgroup$
0
$\begingroup$

Here's my 2 cents to this problem:

It's either all 3 are speaking the truth, or all of them are lying. Which makes it chances of 2/3 and 1/3 respectively.

So, the probability of raining is either Event: Rain and Truth, or Event: No Rain and Lie.

Let's assume the prior chances of rain in Seattle is 25%.

In that case, P(Rain | Y Y Y) = (0.25 * 2/3) / (0.25 * 2/3) + (0.75 * 1/3) = 0.4

So, the chance of actually raining in Seattle would be 40%

$\endgroup$
0
$\begingroup$

No matter it is raining or no, the possibility of $3$ friends take same action is $111$ and $000$ out of $6$ permutations that is always gonna be $1/3.$
Or you can do $(2/3)^3 + (1/3)^3 = 1/3\;$ which makes more sense to the question, since they either all lie or all be honest. So the base possibility of the problem is $\;1/3.\;$ The probability of it rains and $3$ friends speaking the truth is $(2/3)^3 = 8/27.\;$ Therefore $p$ of raining is $(8/27) / (1/3) = 8/9$

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.