TITLE: Why are all subset sizes equiprobable if elements are independently included with probability uniform over $[0,1]$?
QUESTION [13 upvotes]: A probability $p$ is chosen uniformly randomly from $[0,1]$, and then a subset of a set of $n$ elements is formed by including each element independently with probability $p$. In answering Probability of an event if r out of n events were true. I realized that the probability
$$
\int_0^1\binom nrp^r(1-p)^{n-r}\mathrm dp=\frac1{n+1}
$$
of obtaining a subset of size $r$ is independent of $r$; so all $n+1$ subset sizes are equiprobable. This is a neat fact that I wasn’t aware of before. There must be a nicer, more insightful way to show this than to evaluate this integral (which can be done using integration by parts).

REPLY [3 votes]: The following is in terms of generating functions. It does not use binomials or beta integrals.
A coin has probability $p$ for heads, and is thrown $n$ times. If you obtain $r$ heads you gain $x^r$. The expected gain then is
$$E(p)=\bigl(px+(1-p)\bigr)^n\ .$$
As $p$ is uniformly distributed over $[0,1]$ we now have to calculate
$$E:=\int_0^1 E(p)\>dp={1\over n+1}{\bigl(px+(1-p)\bigr)^{n+1}\over x-1}\Biggr|_{p=0}^{p=1}={1\over n+1}{x^{n+1}-1\over x-1}\ ,$$
hence
$$E={1\over n+1}(1+x+x^2+\ldots+x^n)\ .$$
This shows that each $r\in[0\>..\>n]$ has the same "overall" probability to occur.