# If I flip a coin 1000 times in a row and it lands on heads all 1000 times, what is the probability that it’s an unfair coin?

Consider a two-sided coin. If I flip it $1000$ times and it lands heads up for each flip, what is the probability that the coin is unfair, and how do we quantify that if it is unfair?

Furthermore, would it still be considered unfair for $50$ straight heads? $20$? $7$?

First of all, you must understand that there is no such thing as a perfectly fair coin, because there is nothing in the real world that conforms perfectly to some theoretical model. So a useful definition of “fair coin” is one, that for practical purposes behaves like fair. In other words, no human flipping it for even a very long time, would be able to tell the difference. That means, one can assume, that the probability of heads or tails on that coin, is $1/2$.

Whether your particular coin is fair (according to above definition) or not, cannot be assigned a “probability”. Instead, statistical methods must be used.

Here, you make a so called “null-hypothesis”: “the coin is fair”. You then proceed to calculate the probability of the event you observed (to be precise: the event, or something at least as “strange”), assuming the null-hypothesis were true. In your case, the probability of your event, 1000 heads, or something at least as strange, is $2\times1/2^{1000}$ (that is because you also count 1000 tails).

Now, with statistics, you can never say anything for sure. You need to define, what you consider your “confidence level”. It’s like saying in court “beyond a reasonable doubt”. Let’s say you are willing to assume confidence level of 0.999 . That means, if something that had supposedly less than 0.001 chance of happening, actually happened, then you are going to say, “I am confident enough that my assumptions must be wrong”.

In your case, if you assume the confidence level of 0.999, and you have 1000 heads in 1000 throws, then you can say, “the assumption of the null hypothesis must be wrong, and the coin must be unfair”.
Same with 50 heads in 50 throws, or 20 heads in 20 throws. But not with 7, not at this confidence level. With 7 heads (or tails), the probability is $2 \times 1/2 ^ {7}$ , which is more than 0.001.

But if you assume confidence level at 95% (which is commonly done in less strict disciplines of science), then even 7 heads means “unfair”.

Notice that you can never actually “prove” the null hypothesis. You can only reject it, based on what you observe is happening, and your “standard of confidence”. This is in fact what most scientists do – they reject hypotheses based on evidence and the accepted standards of confidence.

If your events do not disprove your hypothesis, that does not necessarily mean, it must be true! It just means, it withstood the scrutiny so far. You can also say “the results are consistent with the hypothesis being true” (scientists frequently use this phrase). If a hypothesis is standing for a long time without anybody being able to produce results that disprove it, it becomes generally accepted. However, sometimes even after hundreds of years, some new results might come up which disprove it. Such was the case of General Relativity “disproving” Newton’s classical theory.