Is it unlikely to get the same number of heads/tails?

Solution 1:

It is fairly unlikely if $n$ is large. The probability of $n$ heads and $n$ tails is $${2n\choose n} {1\over 4^n}.$$

We have $${2n\choose n} = {(2n)!\over n!n!}.$$

Stirling's formula states that as $n$ becomes large, $$n! \sim {n^ne^{-n}\sqrt{2\pi n}},$$ where we say $a_n\sim b_n$ if $a_n/b_n \to 1$ as $n\to\infty$. Using this formula,

$${2n\choose n}{1\over 4^n}\sim {1\over 4^n}\left((2n)^{2n}e^{-2n} \sqrt{4\pi n}\right) \left(1 \over\sqrt{2\pi n} n^ne^{-n}\right)^2 $$

Cancel the exponentials and the $n^n$s and we get

$${2n\choose n}{1\over 4^n}\sim {2^{2n}\over 4^n}{2\sqrt{\pi n}\over 2\pi n } = {1\over \sqrt{n\pi}}.$$

So you can see that this probability decays like $1/\sqrt{n\pi}$ as $n$ gets large. So if $n$ gets 100 times larger, this probability diminishes by a factor of 10.

Solution 2:

It is the most likely single outcome, but it is very unlikely, and it becomes less likely as $n$ increases. As $k$ goes from $0$ to $n$, the split $n+k,n-k$ becomes increasingly unlikely. Already with $n=10$ the probability of a $10,10$ split is only

$$\frac{\binom{20}{10}}{2^{20}}\approx 0.1762\;,$$

but an $11,9$ split is less likely, at $$\frac{\binom{20}{11}}{2^{20}}\approx 0.1602\;,$$ and a $12,8$ split is less likely yet, at $$\frac{\binom{20}{12}}{2^{20}}\approx 0.1201\;.$$

By the time you get to $n=100$, the probability of an even split is only about $0.0563$, and the probability of a $120,80$ split is down to about $0.0010$.

For more information, search on binomial distribution; the Wikipedia article to which I linked gives you a starting point.

Added: For large $n$ you can use the normal approximation to the binomial distribution. When tossing $2n$ fair coins, that’s the normal distribution with mean $n$ and standard deviation $\frac1{\sqrt{2n}}$. If $n=10^6$, for instance, the standard deviation is approximately $1414.21$, and the probability of an even split is $\frac1{1000\sqrt{\pi}}\approx 0.000564$. Using the second calculator here, with parameters

$$\begin{align*} \text{Mean:}&1000000\\ \text{Sd.:}&1414.21\\ \text{Shaded Area:}&0.000564\\ \text{Outside:}& \end{align*}$$

returns $995123.2935\text{ or }1004876.7065$, meaning that that the probability of getting fewer than $995123.2935$ or more than $1004876.7065$ heads is about $0.000564$. Thus, the $k$ for which the probability of getting a difference of more than $2k$ in the numbers of heads and tails is the same as the probability of an even split is about $4877$ when $n=10^6$. You can play with the calculator to get $k$ for other values of $n$.

Solution 3:

It depends on what you compare it to.

Getting 1,000,000 heads is slightly more likely than getting 1,000,023 heads. It is also slightly more likely than getting 1,000,282 heads.

But getting either 1,000,023 or 1,000,282 heads is together more likely than getting exactly 1,000,000 heads.

And getting "more than 998,000 and less than 1,002,000 but not 1,000,000 exactly" is much more likely than getting 1,000,000 heads.


However, for any biased coin it is even less likely that you'll get exactly 1,000,000 heads -- so what you should suspect if you experience this is not that the coin is biased, but that somebody is actively manipulating the coin to get heads and tails to even out better than you have a right to expect.

If $N$ is a less nice number than 1,000,000 (such as, say, 1,371,388) one should also be very suspicious of how that particular $N$ was chosen. Perhaps somebody decided to stop the experiment after exactly 2,742,776 throws exactly because at that point in time there happened to be equally many heads and tails. If you're doing a long series of throws, then it is quite likely that there will be some $N$ among all the possible places to stop the series where it will match exactly.

Solution 4:

The easiest way to answer the second part of your question is to continue along the line of Brian M. Scott's answer.

A fair coin flip is a Bernoulli variable $F$ of parameter $p=1/2$: it returns 0 with probability $1/2$ and $1$ with probability $1/2$. The sum of $2N$ coin flips is the sum of $2n$ Bernoulli variables of parameter $p$, and that is the definition of the binomial distribution $Bin(2n,p)$.

What are you asking, is what is the probability that $Bin(2n,p)=n$, or if we rescale (to consider that the coin flips are valued with $-1$ and $+1$, instead of $0$ and $1$), what is the probability that $(2*Bin(2n,p)-n)=0$. Either way it's a binomial distribution.

Next, if you go to Wikipedia, as previously suggested, you can find two interesting facts:

  • first the PDF $f(k)$ and CDF $F(k)$ of the binomial distribution: basically this gives you the function with which you can tell you both things you've asked, as the probability that the number of heads and tails are exactly the same is $f(n)$, and the probability that it deviates by, say, 10% is $F(1.10*n) - F(0.90*n)$;

  • second, you get an even simpler approximation: the binomial distribution, like all distributions that can be defined as the sum of another, is affected by the Central Limit Theorem, which means that when $n$ is large enough, the distribution is very well approximated by a normal.