You participate in a coin-flipping game in which you win based on how many heads show up. In this game you flip a fair coin $n$ times. For each time that you flip a coin you pay $d$ dollars. If Head shows up M times you win $2M^2 + M$ dollars. What is the expected value of the net reward.
So far, I have:
Net Reward $R(m) = 2m^2 + m - nd$
// Here I subtract the total cost of a game with its total earning . $n$ is considered a constant.
$$P(M = m) = {n\choose m} (\frac{1}{2})^m (\frac{1}{2})^{n - m}$$
The expected net Reward would be:
$$\mathbb{E}[R(m)] = \sum_{m = 0}^{n} {n\choose m} (\frac{1}{2})^m (\frac{1}{2})^{n - m} [ 2m^2 + m - nd]$$
The identity below exists but I do not know how to use it to solve the summation above. $$ (a + b)^n = \sum_{m = 0}^n{n \choose m}(a)^m(b)^{n - m} $$
Is there anything wrong with my approach thus far? And help for solving the summation would be appreciated. If you think that there is no known solution to the summation, Let me know! . .
Guide:
$M \sim Bin(n , \frac12)$, hence $E[M]= \frac{n}{2}$ and $Var(M)=\frac{n}{4}$.
Hence $$E[M^2]-E[M]^2 = \frac{n}{4}$$
Solve for $E[M^2]$, use the linearity of expected value and you should be able to solve the problem.
Edit:
$$E[M^2] = \frac{n}{4}+ \frac{n^2}{4}=\frac{n(n+1)}{4}$$
Hence, the desired output is $$2E[M^2]+E[M]-nd=\frac{n(n+1)}{2}+\frac{n}{2}-nd=\frac{n(n+2)}{2}-nd$$