If I were to flip n coins and compute the product of the number of heads versus the number of tails what would be the expected value of this product?
My logic: In n coin flips n/2 coins will be expected to be head and n/2 will be expected to be tails. So the expected value should $n^2/4$
This logic doesn't make sense when you set values for $n$. For example when $n=1$, the expected value using my logic is $1/4$. But regardless, the product will be $0$ because we will get $0$ of either heads or tails.
Similarly, when $n=2$. We can get HH, TT, HT, TH. So in 2 cases we have a product of 0 and in 2 cases we have a product of 1. Adding this together(after multiplying with $1/4$) we get the expected value should be $0.5$. But using my logic the expected value is $1$.
What's wrong with my logic and a hint on how to approach this problem would be awesome! Thanks