2

Flip a fair coin $n$ times. Let $H$ denote the number of heads and $T$ the number of tails. What is $\mathbb{E}[\min(H,T)]$?

We know that $\mathbb{E}[H]=\mathbb{E}[T]=n/2$, and that $H$ and $T$ are distributed according to a binomial distribution, which has mean $n/2$ and variance $n/4$. Also, $T=n-H$ always. How can we find $\mathbb{E}[\min(H,n-H)]$?

RobPratt
  • 50,938
pi66
  • 7,444
  • 2
    @A.S. I don't see a symmetry argument that would give $n/4$. – pi66 Dec 30 '15 at 11:11
  • @A.S. I doubt $E(\max-\min)=n/2$ is true.. it is unlikely for the number of heads and tails to be far apart. – pi66 Dec 30 '15 at 11:19
  • Maybe $\min(x, y) = x - \max(x-y, 0)$ can somehow be used, although I wasn't able to get any closed-form solution with that. –  Dec 30 '15 at 11:37

2 Answers2

5

Observe that $H$ has binomial distribution with parameters $n$ and $p=\frac12$.

So expectation $\mathbb E[\min(H,n-H)]$ is found by calculating:$$2^{-n}\sum_{k=0}^{n}\binom{n}{k}\min\left(k,n-k\right)$$


addendum:

Hints for special case: $n$ is odd:

$$\sum_{k=0}^{2m+1}\binom{2m+1}{k}\min\left(k,2m+1-k\right)=2\sum_{k=1}^{m}\binom{2m+1}{k}k=2\left(2m+1\right)\sum_{k=1}^{m}\binom{2m}{k-1}$$

and:

$$2\sum_{k=1}^{m}\binom{2m}{k-1}=2\sum_{k=0}^{m-1}\binom{2m}{k}=\sum_{k=0}^{2m}\binom{2m}{k}-\binom{2m}{m}=2^{2m}-\binom{2m}{m}$$

Do check me on mistakes, though. This stuff is slippery.


closed form for odd $n$:$$n\left[\frac{1}{2}-\binom{n-1}{\frac{1}{2}n-\frac{1}{2}}2^{-n}\right]$$

closed form for even $n$:$$n\left[\frac{1}{2}-\binom{n}{\frac{1}{2}n}2^{-n-1}\right]$$

drhab
  • 153,781
  • So the sum is roughly twice the sum $\binom{n}{0}0+\binom{n}{1}1+\ldots+\binom{n}{n/2}n/2$. Is there a closed form for this sum? It doesn't remind me of any binomial identity. – pi66 Dec 30 '15 at 11:02
  • I have added something that might help. – drhab Dec 30 '15 at 11:45
  • See also http://math.stackexchange.com/questions/1134962/expectation-of-half-of-a-binomial-distribution – leonbloy Dec 30 '15 at 11:52
  • @drhab I tried plugging $n=20000$ to both the closed form and the equation in mathematica... both gave me very big numbers.: n ((1/2) - ((Binomial[n, (1/2) n])*2^(-n - 1))) and (2^(-n))*Sum[Binomial[n, i]*Min[i, n - i], {i, n}] – JPCF Jan 05 '16 at 13:38
  • @JPCF What number then? It is evident that it cannote exceed $\frac12\times20000=10000$. – drhab Jan 05 '16 at 14:20
  • @drhab sorry, I'm new to Mathematica too, so I forgot to use N[]. The value is $E[min(H,n-H)]=9943.58$ – JPCF Jan 05 '16 at 14:32
  • 1
    @JPCF Well, that sounds reasonable to me. the number of tails and heads will not be too far from eachother. – drhab Jan 05 '16 at 14:34
  • @drhab why $\mathbb{E}[\min(H,n−H)]$ is not taken directly to be $\frac{n}{2}$ instead of posing a formula? – JPCF Jan 05 '16 at 17:36
  • @JPCF Simply because $\mathbb E[\min(H,n-H)]\neq\frac{n}2$. It is definitely smaller. – drhab Jan 05 '16 at 17:59
0

Given natural $\text{n}$, it suffices to show that $$\sum_{h\ =\ 0}^{\text{n}}\ \text{min}\left(h,\text{n}-h\right)\cdot\binom{\text{n}}{h}\ =\ \text{n}\cdot\left(2^{\text{n}-1}-\binom{\text{n}-1}{\left\lfloor\tfrac{\text{n}}{2}\right\rfloor}\right)$$ (note the minor typo in the accepted answer). The claim follows from a counting argument: \begin{align*} \sum_{h\ \colon\ \text{n}+1} \text{min}\left(h,\text{n}-h\right)\cdot\binom{\text{n}}{h}\ &=\ \sum_{h\ \colon\ \text{n}+1} \sum_{\substack{H\ \subseteq\ \text{n} \\ \left|H\right|\ =\ h}}\ \sum_{\substack{i\ \colon\ \text{n} \\ i\ \colon\ H \iff \left|H\right|\ \leq\ \tfrac{\text{n}}{2}}}\ 1\\ &=\ \sum_{H\ \subseteq\ \text{n}} \sum_{\substack{i\ \colon\ \text{n} \\ i\ \colon\ H \iff \left|H\right|\ \leq\ \tfrac{\text{n}}{2}}}\ 1\\ &=\ \sum_{i\ \colon\ n} \sum_{\substack{H\ \subseteq\ \text{n} \\ i\ \colon\ H \iff \left|H\right|\ \leq\ \tfrac{\text{n}}{2}}}\ 1\\ &=\ \sum_{i\ \colon\ \text{n}}\ \left(\sum_{\substack{H\ \subseteq\ \text{n} \\ i\ \colon\ H\ \land\ \left|H\right|\ \leq\ \tfrac{\text{n}}{2}}}\ 1\ +\ \sum_{\substack{H\ \subseteq\ \text{n} \\ i\ \not\colon\ H\ \land\ \left|H\right|\ >\ \tfrac{\text{n}}{2}}}\ 1\right)\\ &=\ \sum_{i\ \colon\ \text{n}}\ \left(\sum_{\substack{H\ \subseteq\ \text{n}\setminus\left\{i\right\} \\ \left|H\right|\ \leq\ \tfrac{\text{n}}{2}-1}}\ 1\ +\ \sum_{\substack{H\ \subseteq\ \text{n}\setminus\left\{i\right\} \\ \left|H\right|\ >\ \tfrac{\text{n}}{2}}}\ 1\right)\\ &=\ \sum_{i\ \colon\ \text{n}}\ \sum_{\substack{H\ \subseteq\ \text{n}\setminus\left\{i\right\} \\ \left|H\right|\ \neq\ \left\lfloor\tfrac{\text{n}}{2}\right\rfloor}}\ 1\\ &=\ \boxed{\text{n}\cdot\left(2^{\text{n}-1}-\binom{\text{n}-1}{\left\lfloor\tfrac{\text{n}}{2}\right\rfloor}\right)} \end{align*} Where "$\text{n}$" is doubly interpreted as the natural it names and as the set $\left\{0,\dots,\text{n}-1\right\}$ and "$\colon$" serves as shorthand for "$\in$". $\blacksquare$

(If one carefully considers what each sum above is actually computing, I think they'll agree that there's essentially no algebraic manipulation involved despite the argument's presentation.)

Rafi
  • 1,686