13
$\begingroup$

I saw some result that some article used, (without proving) that stated:$$\int_0^1 p^k (1-p)^{n-k} \mathrm{d}p = \frac{k!(n-k)!}{(n+1)!}$$

But I was wondering, how would you integrate it? How did this integral come about? Is it something to do with the binomial distribution?

  • 3
    [Beta function](http://en.wikipedia.org/wiki/Beta_function)2012-03-19
  • 1
    see too [Weisstein's derivation](http://mathworld.wolfram.com/BetaFunction.html)2012-03-19
  • 0
    Ahh okay, thanks for the heads up! :)2012-03-20

4 Answers 4

8

There are probably several ways. An easy one is by induction on $k$.

If $k=0$, then $$ \int_0^1(1-p)^n\,dp=\left.-\frac{(1-p)^{n+1}}{n+1}\right|_0^1=\frac1{n+1}=\frac{0!(n-0)!}{(n+1)!}. $$ Now assume that the formula holds for some $k$. Then, integrating by parts, $$\begin{eqnarray} \int_0^1p^{k+1}(1-p)^{n-(k+1)}\,dp&=&\int_0^1p^{k+1}(1-p)^{(n-1)-k}\,dp\\ &=&\left.-\frac{p^{k+1}(1-p)^{n-k}}{n-k}\right|_0^1+\int_0^1\frac{(k+1)p^k(1-p)^{n-k}}{n-k}\,dp\\ &=&\frac{(k+1)}{n-k} \frac{k!(n-k)!}{(n+1)!}\\ &=&\frac{(k+1)!(n-(k+1))!}{(n+1)!}. \end{eqnarray}$$ The induction principle then guarantees that the formula holds for all $k$.

  • 1
    Thanks martin, didnt realise I could do it by induction!2012-03-20
8

Not a natural derivation, but there is slightly different approach toward it.

Let's consider the quantity

$$I(n,k) = \int_{0}^{1} \binom{n}{k} p^k (1-p)^{n-k} \; dp.$$

Then by integration by parts, as in two former answers, we have

$$I(n, k+1) = I(n, k).$$

Let $I$ denote this common value. Thus

$$1 = \int_{0}^{1} 1 \; dp = \int_{0}^{1} \sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} \; dp = \sum_{k=0}^{n} I = (n+1)I$$

and the result follows.

  • 1
    Thanks for your help sos440, nice to see a diff. way also!2012-03-20
8

You can also proof it "by story". Let "random number" mean a number picked from $[0,1]$ with uniform probability. Then the formula below can be interpreted as follows.

$$\int_0^1 p^k (1-p)^{n-k} \mathrm{d}p = \frac{k!(n-k)!}{(n+1)!}$$

The left-hand side is the probability of taking random $p$ and then drawing a sequence of $n$ numbers from which some $k$ numbers are smaller than $p$ and some $n-k$ are larger.

To understand the right-hand side, consider $n+1$ random numbers sorted, so that first $k$ are the smallest and last $n-k$ are the largest (with $(k+1)$-th being our $p$ from left-hand side interpretation); however, there are $(n+1)!$ permutations total, with $k!(n-k)!$ having the desired property (in a sorted sequence we disregard the order of first $k$ and last $n-k$), thus the right-hand side fraction denotes the same probability.

  • 0
    Hmm interesting way, cheers!2012-03-20
  • 0
    $p^k(1-p)^{n-k}$ is the probability you described. But what about the integral? Integral makes us talk not about single $p$ but about whole bunch of them.2018-01-22
  • 0
    @Yola $p^k(1-p)^{n-k}$ is the probability of drawing a sequence of $n$ numbers, from which some $k$ numbers are smaller than $p$ and some $n−k$ are larger, _given a particular, fixed value of $p$_. And then, we sum all these probabilities for any possible value of $p$ using the integral. Does that explain your question?2018-01-22
  • 0
    That's exactly that i thought, but i just can't coneive this part with integration. Probably i should just get used to it, and this will become clearer for me later. Thanks! +12018-01-22
  • 0
    @Yola Then I suggest this: imagine the same problem, but say that $p \in \{0, 1/2\}$ (each happening with probability $1/2$). Work out the formula on the left. Then consider $p \in \{0/4, 1/4, 2/4, 3/4\}$ (all with probabilities $1/4$). Then consider $p \in \{0/8, 1/8, \ldots, 7/8\}$, and so on. When you spot the common theme, do $p \in \{0/2^m, 1/2^m, \ldots, (2^m-1)/2^m\}$. Going with $m$ to infinity is exactly the step that makes that sum an integral (here such a simplified integration is possible, because we are integrating a polynomial, which is a very well-behaved function on [0,1]).2018-01-22
7

This can be proven using repeated integration by parts: $$\begin{eqnarray} \int_0^1 p^k(1-p)^{n-k} &=& \frac{1^{k+1}(1-1)^{n-k}}{k+1}-\frac{0^{k+1}(1-0)^{n-k}}{k+1}+\frac{n-k}{k+1}\int_0^1 p^{k+1}(1-p)^{n-k-1}\\ &=& \frac{n-k}{k+1}\int_0^1 p^{k+1}(1-p)^{n-k-1}\\ &=& \frac{(n-k)(n-k-1)}{(k+1)(k+2)}\int_0^1 p^{k+2}(1-p)^{n-k-2}\\ &\vdots&\\ &=& \frac{k!(n-k)!}{n!}\int_0^1 p^{n}=\frac{k!(n-k)!}{n!}\frac{1}{n+1}=\frac{k!(n-k)!}{(n+1)!}\\ \end{eqnarray}$$