# Example of using binomial distribution

Q: Is my approach correct?

Event: You toss 5 coins at once.

A student of mine claimed he got 4T & 1H in 39 out of 40 trials (!!)

I decided to calc the odds of this...

First, P(4T & 1H) = 5C4 * (1/2)^4 * (1/2)^1 = .16

I did this 2 ways:

1) Binomial Probability

n = 40

r = 39

p = .16

q = .84

P(Exactly 39) = 40 C 39 * (.16)^39 * (.84)^1 = 0%

2) Binomial Distribution:

n = 40

r = 39 (or more)

p = .16

q = .84

E(X) = u = np = (.16)(40) = 6.4

SD = SQRT(npq) = 3.16

Z(39) = (observed - expected) / SD = (39 - 6.4) / 3.16 = 10.3

p = P( Z > 10.3) = 0%

Conclusion: The odds of getting 4T & 1H in 39 out of 40 trials is negligible.

Student was on drugs at the time.

-
Why would you calculate the probability of exactly 39 in case 1, but 39 or higher in case 2? –  rpierce Aug 10 '10 at 16:20
@drknexus Case 2 is a continuous approximation of case 1. Thus, it does not make sense to talk about P(Z=10.3) in case 2. –  user28 Aug 10 '10 at 16:24
@srikant-vadali By the common definition of p-value it should include more extreme cases in addition to the one observed. So the first calculation should be P(39 or 40). Still very small though. –  Aniko Aug 10 '10 at 18:05
@Aniko I think we need to calculate p-values if the question involves inference about a parameter. But, the OP's qn is about the probability of observing a particular event. So, I think case 1 calculation is fine. If we want to compute the probability that we would see at least 39 such events then you would compute P(39 or 40) but perhaps I misinterpreted the OP's goals here. –  user28 Aug 10 '10 at 18:19
@srikant-vadali Then per drknexus the second calculation should also do the same, something like P(38.5<X<39.5). –  Aniko Aug 10 '10 at 19:27

The probability of observing 4 heads and 1 tail 39 times out of 40 after observing 4 heads and 1 tail 39 times out of 40 is 1.0.

:)

-
I do not understand your answer. Suppose, you do not know P(H) and you have to estimate it. You have to write Prob(4H, 1T 39 times out of 40) in terms of P(H) and estimate P(H). Your answer suggests that the probability of observing the event in question is always 1 and hence independent of P(H). I am not sure if that makes sense. Did I miss something? –  user28 Aug 10 '10 at 19:13
The student observed a result that appears odd. But once it's observed it's no longer odd, it simply is random chance. The probability of observed data occurring after you've already observed it is always 1.0. I put the smiley in because I recognize that you want to know if it's plausible. But that would involve not only working out the probability of it occurring once but the probability of it occurring given all the students who've ever attempted it and the number of attempts they made. (also, consider that 4 heads and 1 tail in 39 of 40 attempts has the same probability) –  John Aug 10 '10 at 19:36
How does what you say reconcile with the estimation problem I posed in my comment? –  user28 Aug 10 '10 at 19:42
First, I was making a stats joke. But there is a serious point. If you believe the student then the probability is 1.0 because the data have already been observed. –  John Aug 10 '10 at 19:52
But, that is exactly the point isn't it? The OP does not trust the student and wants to make an assessment of how likely the event is under reasonable assumptions (P(H)=0.5, independence etc). –  user28 Aug 10 '10 at 20:00
show 1 more comment

How about a simulation based approach? Here's some R code to generate 100000 students each trying the 40 tosses.

theSum = c()
for (i in 1:100000) {
coin1 = rbinom(40,1,.5)
coin2 = rbinom(40,1,.5)
coin3 = rbinom(40,1,.5)
coin4 = rbinom(40,1,.5)
coin5 = rbinom(40,1,.5)
theSum[i] = sum(coin1+coin2+coin3+coin4+coin5 == 1)
}

summary(theSum)
hist(theSum, xlim = c(0,40), freq = F, main = "", xlab = "")


The range of times the HTTTT combination occurred (in any order): 0-18 (out of 40), with a mean of around 6.

Below: a histogram of the 100000 attempts and how many times the magical combination occurred. You'd have to be very lucky indeed to get it 39 times out of 40 with fair coins. But stranger things have happened by chance (e.g., our evolution).

-

It must be indicative of something besides the redistribution of wealth.

A weaker man might be moved to re-examine his faith, for nothing else at least in the law of probability...

Consider. One, probability is a factor which operates within natural forces. Two, probability is not operating as a factor. Three, we are now held within um... sub or supernatural forces. Discuss!

What?

Look at it this way. If six monkeys... If six monkeys... The law of averages, if I have got this right means... that if six monkeys were thrown up in the air long enough... they would land on their tails about as often as they would land on their...

Heads, getting a bit of a bore, isn't it?

– Tom Stoppard Rosencrantz and Guildenstern are Dead (1966)

As John Christie pointed out, no matter how unlikely the student's result was, you can't infer anything from a single trial. A clever student might well have tried this gambit knowing it could not be refuted, in which case I might be inclined to commend her.

Incidentally, Rosencrantz (or Guildenstern) tossed at least 157 consecutive heads and it was nothing to write home about.

-