# Probability of throwing n/2 heads out of n tosses

1. May 21, 2012

### WCMU101

Doing a bit of study for an interview. Came across this question:

"n unbiased coins. What is the probability that half of them exactly are
heads. Answer the question for n= 2, 3, 20000."

My answers would be:

n = 2: p(1h) = 0.5
n = 3: p(1.5h) = 0
n = 20000: p(10000h) = approx. 0 (close enough to a continuous random variable?)

Do you agree/disagree?

Also just checking another one:

"2 fair dice. What is the probability of both showing six if I have observed
at least one six."

I would say the answer is 1/11 - working: (1*P(2 6's)/(1-P(0 6's))). Is that correct?

Thanks for any advice!

Nick.

2. May 22, 2012

### SW VandeCarr

For x=10,000 P=0.011 from the normal approximation. Note that would be P(x):$9999.5\leq x< 10000.5$ You can do this because the underlying binomial distribution is discrete.

?
If you observe one of a pair of dice showing 6, why would the probability that the unobserved die would be P(x=6) = 1/11.? Obviously P(x=6) = 1/6.

Last edited: May 22, 2012
3. May 22, 2012

### WCMU101

Thanks for the quick reply!

Regarding the first question: Could you come up with that answer without electronic aid? It approaches the normal distribution due to central limit theorem and the mean is 10000 and variance 20000*.5*.5=5000. So I could write the pdf, but I could not do the integration analytically. I'm not sure.

For the second question: Yeah now that I think about it my answer sounds stupid. I kind of just jumped at Bayes' theorem. Yet, I feel like I still should have got the correct answer - could you tell me where I've gone wrong:

P(2 6's | observed at least 1 6) = P(observing at least 1 6 | 2 6's)*P(2 6's)/P(observing at least 1 6)

P(2 6's | observing at least 1 6) = 1*(1/36)/(1-25/36) = 1/11

Any help would be greatly appreciated!

Thanks.

Nick.

Last edited: May 22, 2012
4. May 22, 2012

### SW VandeCarr

You can do it analytically, but why would you want to do it by hand? This is why we have computers.

P((X2=6)|X1=6) = ((1/6)(1))/1 = 1/6. X1 is the first die which you observed, so P(X1=6)= 1.

5. May 22, 2012

### WCMU101

That first question was (apparently) asked in an interview - generally no calculators/computers. I didn't think it was possible to integrate the normal pdf analytically. It is easy to work with the normal pdf when you are working in terms of standard deviations (68-95-99.7 rule). Calculating 20000C10000*(.5^20000) is also too difficult to do by hand and I don't think many calculators can handle it either (I think).

For the second one I would've gone:

P(X2=6 | X1=6) = P(X1=6 | X2=6)*P(X2=6)/P(X1=6) = P(X1=6)*P(X2=6)/P(X1=6) = P(X2=6) = 1/6

Bayes' is killing me at the moment haha if I get the wording wrong I get the question wrong.

Thanks!

Nick.

Last edited: May 22, 2012
6. May 22, 2012

### haruspex

I'm afraid SW VandeCarr is misleading you wrt the dice. You were correct in the first place, it's 1/11. See my response to your Bayes question.

For the coins, we have:
$\left(^{2n}_{n}\right).2^{-n}$ =
(2n)!/(n!n!.2^n)
Do you know Stirling's approximation for factorials? Very useful:
n! ~ (n/e)^n.√(2πn)
Using this, the above reduces to 1/√(πn)

7. May 22, 2012

### SW VandeCarr

Sorry. You'll have to explain why the probability of one die showing 6 is not 1/6 if you already know the value of the other die. is 6. It can only have 6 possible values.

Last edited: May 22, 2012
8. May 22, 2012

### viraltux

Hi SW VandeCarr,

I think it is about the wording, it is easy to make a mistake:

P (observing at least one 6) = 11/36
P (first dice is 6) = 1/6

You were thinking about the second... right? Natural language can be quite misleading in statistics.

9. May 22, 2012

### SW VandeCarr

Sorry. Probability is about uncertainty. You only have uncertainty about one die.

10. May 22, 2012

### viraltux

Obviously in the way you think about this experiment this is so, so if I tell you "the first dice is 6" then your reasoning holds. But how about if I see the two dices and I only tell you "there is at least one 6"? Now you have uncertainty about both dices because you don't know which dice is 6 or if they both are 6.

11. May 22, 2012

### SW VandeCarr

There need not be any assumption about order. I only need to be uncertain about one die which is the case here.

12. May 22, 2012

### viraltux

Well, I kindly disagree but hey, maybe I'm wrong and someone else can explain it better, I'm always willing to learn

13. May 22, 2012

### haruspex

Roll two dice: 36 equally likely possible outcomes.
In 1 of those both are 6, in 10 of them exactly one is a 6.
I cannot see the dice, so I ask you "Is at least one a six?".
If you answer yes, that cuts it down to 11 possibilities, of which one is both sixes.
So the probability that the other is also a six is 1/11.

Suppose instead I asked you "Is the one you threw first a six?"
Now you will only answer yes for six cases, and in one of those the other is a six.
So now the probability that the other is also a six is 1/6.

The crucial thing to understand is the set of circumstances under which the information given would be true. They are not the same for the two wordings.

14. May 22, 2012

### SW VandeCarr

This is the question I answered.

15. May 25, 2012

### D H

Staff Emeritus
While asking nonsense questions has been in the vogue for a while, I for one don't do that. In other words, I would only ask that question if I expected you to know something about probability and statistics. And that answer of approximately is not good enough in this case. You should know either the binomial distribution or the law of large numbers. The binomial distribution quickly gives the exact answer, $\frac{20000!}{(10000!)^2}2^{-20000}$.

"Oh, you want a decimal expression? Let me use my computer. [Short while later] It's about 0.0056."

That's a pretty lousy estimate. It's off by a factor of two.

I would say that this is a verging on one of those poorly worded statistical question that is begging to be misinterpreted. There's nothing wrong with asking an interviewer for a clarification. If he looked at both dice and reported that at least one is a six, your answer of 1/11 is correct. If he looked at only one die and said that at least one of the dice was a six (because he happened to see a six on the die he looked at), the answer is 1/6.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook