23

If you toss a coin $2n$ times the chance of getting heads $n$ times is $$\frac{1}{4^n} \binom{2n}{n} $$ (simple combinatorics problem).

Now I've made a seemingly obscure observation: $$\int_0^{2 \pi}\sin^{2n}(x)\,dx = \frac{2 \pi}{4^n} \binom{2n}{n} $$

The identities only differ by a factor of $2 \pi$. Is there an explanation for this phenomenon or just a cool coincidence?

UPDATE: As Aloizio Macedo pointed out, a fairly related question has been answered with a combinatorial proof by Qiaochu Yuan here.

Staki42
  • 2,825
  • Why $\frac14$? Why not $\frac12$? Or aren't there $2$ coins? – zoli Nov 04 '17 at 12:58
  • @zoli: $(1/2)^{2n} = 1/4^n$. – Hans Lundmark Nov 04 '17 at 12:59
  • Of, stupid of me!! – zoli Nov 04 '17 at 13:00
  • 1
    Note the integral can just as well be written: $$\int_0^{2\pi}\cos^{2n}x,dx$$ Probably easier to deal with. And it can be written as a complex integral: $$\frac{1}{4^ni}\int_{\Gamma} (z^2+1)^{2n}z^{-n-1},dz$$ where $\Gamma$ is any clockwise loop one time around $0$. Again, not sure if that helps. – Thomas Andrews Nov 04 '17 at 13:30
  • 3
    If you divide through by $2\pi$ the LHS becomes the average value of $\sin^{2n}(x)$, but I don’t know if that gets you anywhere. – Stella Biderman Nov 04 '17 at 13:31
  • 1
    @StellaBiderman that is something I considered too, and it sounds astonishing to me that "the average value of $\sin^{2n}(x)$ is the probability of getting $n$ heads in $2n$ coin throws". – Staki42 Nov 04 '17 at 13:34
  • 1
    Arbitrary example: If $f(x)=\ln x$ and $g(x)=\sin x$, we have that $f(1)=g(\pi)=0$. What is the relationship here? Well, $f$ and $g$ are certainly connected in some roundabout way through the foundations of mathematics, but are they really connected "conceptually" or "phenomenally"? It is more likely the case that there is no close conceptual connection between any two arbitrary math equations that give the same result. However, that doesn't change the fact that it is indeed fascinating! – jdods Nov 04 '17 at 16:19
  • 1
    This has got to be related to Fourier transforms somehow. – Nate Eldredge Nov 04 '17 at 18:20
  • 2
    Related: https://math.stackexchange.com/questions/24533/find-the-average-of-sin100-x-in-5-minutes – wythagoras Nov 04 '17 at 19:03
  • 1
    Look at the answer by Qiaochu Yuan in the answer linked by @wythagoras in the comment above. It seems to answer your question. – Aloizio Macedo Nov 04 '17 at 19:09
  • I'm intrigued by the possibility that the characteristic function of a coin toss with values $-1$ and $1$ is $\cos t$. So $\cos^n t$ is the characteristic function of the sum of $n$ independent tosses of such a coin. While that is the "same" as the usual proof that the integral has value $4^{-n}\binom{2n}{n}$, it at least gives an idea of the purpose/meaning of the characteristic function. – Thomas Andrews Nov 04 '17 at 19:30

3 Answers3

14

This is still not a combinatorial proof, purely, but it avoids complex numbers, at least, and is phrased in terms of probability.

First note that your integral is the same as $\int_{0}^{2\pi}\cos^{2n}x\,dx$.

Now we use the property that $\cos^2 x =\frac{1+\cos 2x}{2}.$ If $X$ is a uniform random variable in $[0,2\pi]$, then the random variables $U=\cos X$ and $V=\cos 2X$ have the same distribution, so it means that $$E\left[U^{2n}\right]=\frac{1}{2^n}E\left[(1+V)^n\right]=\frac{1}{2^n}E\left[(1+U)^n\right]$$ and thus you get an inductive formula. Since $E\left[U^k\right]=0$ when $k$ is odd, you get:

$$E\left[U^{2n}\right]=\frac{1}{2^n}\sum_{k=0}^{\lfloor n/2\rfloor}\binom{n}{2k}E\left[U^{2k}\right]$$

We want to prove $$E\left[U^{2n}\right]=\frac{1}{4^n}\binom{2n}{n}.$$

When $n=0$ we get $E[U^0]=1=\frac1{2^0}\binom{0}{0}.$

Inductively, then, we need to show:

$$\frac{1}{4^n}\binom{2n}{n}=\frac{1}{2^n}\sum_{k=0}^{\lfloor n/2\rfloor}\binom{n}{2k}\frac{1}{2^{2k}}\binom{2k}{k}$$

which is equivalent to:

$$\binom{2n}{n}=\sum_{k=0}^{\lfloor n/2\rfloor}2^{n-2k}\binom{n}{n-2k}\binom{2k}{k}\tag{1}$$

which can be proved combinatorially.

If we think of $\binom{2n}{n}$ as the number of ways of picking an $n$-subset of $\{1,\dots,n\}\times\{1,2\}$ then $k$ is the number of elements $m\in\{1,\dots,n\}$ such that $(m,1)$ and $(m,2)$ are both in the $n$-subset. That means we need to pick an $n-2k$-subset $P$ of $\{1,\dots,n\}$, then for each $p\in P$, choose either $(p,1)$ or $(p,2)$, and then choose $k$ elements of the $2k$ elements not in $P$, and add $(q,1)$ and $(q,2)$ to our subset.

The interesting thing about this proof of $(1)$ is that the meaning of the $\binom{2n}{n}$ on the left side is kind-of different from the meaning of $\binom{2k}{k}$ on the right side.


A power series approach. Even less combinatorial than the first approach.

Consider for $|x|<1$ the function $f(x,t)=\frac{1}{1-x\cos t}=\sum_{k=0}^{\infty} x^k\cos^kt$

The integral $$F(x)=\frac1{2\pi}\int_{-\pi}^{\pi} f(x,t)\,dt$$

can be found by using the Weierstrass substitution. This gives that:

$$\begin{align}F(x)&=\frac{1}{\sqrt{1-x^2}} \end{align}$$

So if $T$ is a uniform random variable in $[0,2\pi]$ you get:

$$\sum_{k=0}^{\infty} x^kE\left[\cos^k T\right]=E[f(x,T)]=F(x)=\frac{1}{\sqrt{1-x^2}}=\sum_{k=0}^{\infty}\frac{1}{4^k}\binom{2k}{k}x^k$$

That last step requires you to know the generating function for the central binomial coefficients, $\binom{2k}{k}$. (Alternatively, if you prove the equality elsewhere, you can use this to prove the central binomial coefficients generating function.)


Finally, maybe the underlying reason is due to the characteristic function for a random variable. Unfortunately, this is essentially an encoding of the proof that starts with $\cos(x)=\frac{1}{2}\left(e^{ix}+e^{-ix}\right).$

Given a random variable, $X$, we have the characteristic function:

$$G_X(t)=E\left[e^{itX}\right]$$

If $X$ is a random integer variable, and $T$ is a uniform random variable in $[0,2\pi]$ then we have a fundamental result:

$$E\left[G_X(T)\right]=P(X=0).$$

Now if $X_1,\dots,X_{n}$ are independent coin tosses returning values $-1$ and $1$, then $G_{X_i}(t)=\cos t$ and $$G_{X_1+\cdots+X_n}=G_{X_1}G_{X_2}\cdots G_{X_n}$$

So if $X=X_1+\cdots+X_n$, then $G_X(t)=\cos^n(t)$ and $$P(X=0)=E[G_X[T]]=\frac{1}{2\pi}\int_{0}^{2\pi} \cos^n t\,dt$$

That's just really fundamentally hiding the usual approach of writing $\cos x= \frac{1}{2}(e^{ix}+e^{-ix})$ and using the algebraic property of the characteristic function.

Thomas Andrews
  • 177,126
13

Well, if you write $$ \sin^{2n} x = \left(\frac{e^{ix}-e^{-ix}}{2i}\right)^{2n} , $$ expand using the binomial theorem, and integrate term by term, everything will be zero except the contribution from the middle (constant) term, $$ \int_0^{2\pi} \binom{2n}{n} (e^{ix})^n (-e^{-ix})^n \,\left(\frac{1}{2i}\right)^{2n} \, dx = 2 \pi \, \binom{2n}{n} \left(\frac{1}{2}\right)^{2n} , $$ which is a bit similar to how the coefficients in the binomial expansion of $(p+q)^{2n}$ tell you the probabilities of getting $k$ heads and $2n-k$ tails when flipping a coin with probability $p$ and $q$ for head and tail.

But whether you would count this as an “explanation”, I don't know...

Hans Lundmark
  • 53,395
6

I thought I had a real approach to this question, but after working a bit, I realized that I needed some Fourier analysis at least.

In a generating function approach, the number of ways to get exactly $k$ heads and $2n-k$ tails would be $\left[x^k\right](1+x)^{2n}$ where each choice of an $x$ represents a head and each choice of a $1$ a tail. Since $$ \frac1{2\pi}\int_0^{2\pi}e^{ikx}\,\mathrm{d}x=\left\{\begin{array}{}1&\text{if }k=0\\0&\text{if }k\ne0\end{array}\right. $$ $\left[x^n\right](1+x)^{2n}$ is simply $$ \begin{align} \frac1{2\pi}\int_0^{2\pi}\left(1+e^{ix}\right)^{2n}e^{-inx}\,\mathrm{d}x &=\frac1{2\pi}\int_0^{2\pi}\left(e^{-ix/2}+e^{ix/2}\right)^{2n}\,\mathrm{d}x\tag1\\ &=\frac{4^n}{2\pi}\int_0^{2\pi}\cos^{2n}(x/2)\,\mathrm{d}x\tag2\\ &=\frac{4^n}{\pi}\int_0^{\pi}\cos^{2n}(x)\,\mathrm{d}x\tag3\\ &=\frac{4^n}{2\pi}\int_0^{2\pi}\cos^{2n}(x)\,\mathrm{d}x\tag4\\ &=\frac{4^n}{2\pi}\int_0^{2\pi}\sin^{2n}(x)\,\mathrm{d}x\tag5 \end{align} $$ Explanation:
$(1)$: distributive property
$(2)$: $2\cos(x/2)=e^{ix/2}+e^{-ix/2}$
$(3)$: substitute $x\mapsto2x$
$(4)$: $\cos^{2n}(x)=\cos^{2n}(x+\pi)$
$(5)$: $\cos^{2n}(x)=\sin^{2n}(x+\pi/2)$

Since there are $2^{2n}=4^n$ possible outcomes, we get the probability of exactly $n$ heads to be $$ \frac1{2\pi}\int_0^{2\pi}\sin^{2n}(x)\,\mathrm{d}x $$

robjohn
  • 345,667
  • 1
    This is well-organized, but doesn't really answer the question - the OP already knows how $\int_0^{2\pi}\sin^{2n}(x)dx$ is calculated, and is asking why the result happens to be the same as the result of a very different calculation. – Reese Johnston Nov 04 '17 at 19:14
  • @Reese: I have had to change the whole approach, but I hope this is fairly explanatory. – robjohn Nov 04 '17 at 20:18