This is a problem from a preparatory GRE preparatory GRE test made by guys form University of Chicago.
Problem: A man flips $10$ coins. With $H$ the number of heads, and $T$ the number of tails, the man then flips $\max \left\{2 H-T^2, 0\right\}$ coins. What is the expected number of heads of both groups?
My solution (giving wrong answer): Let $X$ be the random variable corresponding to the number of heads in both groups. Note that $2H-T^2<0$ for $H<7$ and $2H-T^2>0$ for $H\geq 7.$ To my understanding, the answer must be $$\mathbb{E}(X)=\mathbb{E}(H | 2H-T^2\leq 0) \mathbb{P}(2H-T^2\leq 0) +\mathbb{E}(\xi_1+\xi_2+\xi_3+\xi_4)\mathbb{P}(2H-T^2 > 0),$$ where $\xi_1=7+\text{"number of heads in 5 additional tosses"},\\ \xi_2=8+\text{"number of heads in 12 additional tosses"},\\ \xi_3=9+\text{"number of heads in 17 additional tosses"},\\ \xi_4=10+\text{"number of heads in 100 additional tosses"}.$
Now let's try to carefully calculate that.
$\mathbb{E}(\xi_1+\xi_2+\xi_3+\xi_4)=\sum\limits_{i=1}^4\mathbb{E}(\xi_i)=(7+2.5)+(8+6)+(9+8.5)+(10+50)=101.$
$\mathbb{P}(2H-T^2\leq 0)=\mathbb{P}(H<7)=\frac{1}{2^{10}}+\frac{10}{2^{10}}+\frac{C_{10}^2}{2^{10}}+\frac{C_{10}^3}{2^{10}}+\frac{C_{10}^4}{2^{10}}+\frac{C_{10}^5}{2^{10}}+\frac{C_{10}^6}{2^{10}}=\frac{848}{2^{10}}.$ Consequently, $\mathbb{P}(2H-T^2> 0)=1-\frac{848}{2^{10}}=\frac{176}{2^{10}}.$
Finally, \begin{align*} &\mathbb{E}(H | 2H-T^2\leq 0)=\sum\limits_{n=0}^6 n \mathbb{P}(H=n | H<7)=\sum\limits_{n=0}^6 n \frac{\mathbb{P}(H=n \text{ and } H<7)}{\mathbb{P}(H<7)}=\\ &=\frac{1}{\mathbb{P}(H<7)}\sum\limits_{n=0}^6 n \mathbb{P}(H=n)=\frac{2^{10}}{848} \sum\limits_{n=0}^6 n \frac{C_{10}^n}{2^{10}}=\frac{1}{848} \sum\limits_{n=0}^6 n C_{10}^n=\frac{3820}{848}. \end{align*}
So, $$\mathbb{E}(X)=\frac{3820}{848} \frac{848}{2^{10}} +101 \frac{176}{2^{10}}=\frac{3828+101 \cdot 176}{2^{10}} > 21.$$
My questions:
Where did I make a mistake? According to the authors, correct answer lies between $0$ and $8$. I did the computations on a calculator, so there must be a conceptual error here.
Are there ways to simplify the solution? May be with some geometric interpretation or clever observations. In a real exam there are 2.5 minutes per problem, and I am not sure how one is supposed to finish this so quickly.
Thank you.
The point needing an adjustment is: $$ \begin{aligned} \mathbb{E}[X] &=\mathbb{E}[\ H\ |\ 2H-T^2\ \leq 0]\cdot \mathbb{P}(H\le 6\ ,\ T\ge 4\ ,\ 2H-T^2\leq 0) \\ &\qquad\qquad+\mathbb{E}[\ \xi_1\ ]\cdot \mathbb{P}(H=7\ ,\ T= 3\ ,\ 2H-T^2 =5)\\ &\qquad\qquad+\mathbb{E}[\ \xi_2\ ]\cdot \mathbb{P}(H=8\ ,\ T= 2\ ,\ 2H-T^2 =12)\\ &\qquad\qquad+\mathbb{E}[\ \xi_3\ ]\cdot \mathbb{P}(H=9\ ,\ T= 1\ ,\ 2H-T^2 =17)\\ &\qquad\qquad+\mathbb{E}[\ \xi_4\ ]\cdot \mathbb{P}(H=10\ ,\ T= 0\ ,\ 2H-T^2 =20)\\ &= \sum_{0\le n\le 6}n\cdot\frac 1{2^{10}}\binom {10}n \\&\qquad\qquad +\left(7+5\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}7 \\&\qquad\qquad +\left(8+12\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}8 \\&\qquad\qquad +\left(9+17\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}9 \\&\qquad\qquad +\left(10+20\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}{10}\\ &= 10\cdot \frac 12 \color{gray}{-7\cdot\frac 1{2^{10}}\binom {10}7 -8\cdot\frac 1{2^{10}}\binom {10}8 -9\cdot\frac 1{2^{10}}\binom {10}9 -10\cdot\frac 1{2^{10}}\binom {10}{10}} \\&\qquad\qquad +\left(\color{gray}{7}+5\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}7 \\&\qquad\qquad +\left(\color{gray}{8}+12\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}8 \\&\qquad\qquad +\left(\color{gray}{9}+17\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}9 \\&\qquad\qquad +\left(\color{gray}{10}+20\cdot \frac 12\right)\cdot\frac 1{2^{10}}\binom {10}{10} \\ &=\frac 12\left( 10 +5\cdot\frac{120}{1024} +12\cdot\frac{45}{1024} +17\cdot\frac{10}{1024} +20\cdot\frac{1}{1024} \right) \\ &=5+\frac 1{2048}(600+540+170+20) =5+\frac {1330}{2048} =5+\frac {665}{1024} \\ &=5.6494140625\ . \end{aligned} $$ Here, the mean of the number of heads in an $N$ times repeated Bernoulli experiment with probabilities $p$ for the positive result is $Np$. The above should be doable as it is in five minutes, rough approximations lead also quickly to an upper bound.
Computer check: