Suppose $X$ be the random variable that denotes the number of heads minus the number of tails when $10$ unbiased coins are tossed. Find the variance. Suppose an unbiased coin is tossed $10$ times. Let $X$ be the random variable that denotes the number of heads minus the number of tails. What is the variance of $X$?
This seems to have the solution but I do not understand what it says. I am looking for an explanation of the link I shared.
I am still sharing my solution so as to show I am not posting it without trying it at all.
$\text{E}[X] = \displaystyle\sum_{h=0}^{10} \left(\frac{{10 \choose h}}{2^{10}} (h - (10-h))\right) = \frac{1}{2^{9}} \displaystyle\sum_{h=0}^{10} {10 \choose h} (h-5) = 0$
$\text{E}[X^2] = \displaystyle\sum_{h=0}^{10} \left(\frac{{10 \choose h}}{2^{10}} (h - (10-h))^2\right) = \frac{1}{2^{8}} \displaystyle\sum_{h=0}^{10} {10 \choose h} (h-5)^2 = 10$
This gives $\text{Var}[X] = \text{E}[X^2] - \text{E}[X]^2 = 10 - 0^2 = 10$. This is how I did, considering the PMFs.
 A: Let $Y$ be the random variable that denotes the number of heads out of the 10 coin tosses. Since the coin is unbiased and different tosses are independent of each other, we can model $Y$ as
$$Y \sim Bin(n, p),$$
where $n = 10$ and $p = 0.5$.
Since $X$ is the random variable that denotes the number of heads minus the number of tails, we have that
$$X = \underbrace{Y}_{\text{number of heads}} - \underbrace{(n - Y)}_{\text{number of tails}} = 2Y - n.$$
To get the variance of $X$, first we would like to recap two basic properties of variance: if $a$ is a constant, then
(1) $\text{Var}(X + a) = \text{Var}(X)$;
(2) $\text{Var}(aX) = a^2\text{Var}(X)$.
Back to this problem, we have
\begin{align*}
\text{Var}(X) &= \text{Var}(2Y - n)\\
&= \text{Var}(2Y) \quad & \text{by property (1)}\\
&= 2^2\text{Var}(Y) \quad & \text{by property (2)}\\
&= 4\text{Var}(Y)\\
&= 4np(1-p),
\end{align*}
where the last step follows from the variance of Binomial distribution. Plugging in $n = 10$ and $p = 0.5$, we have
$$\text{Var}(X) = 4np(1-p) = 4 \times 10 \times 0.5 \times (1-0.5) = 10.$$
A: Argument: $n = H+T,$ implies $T = n - H,$ so $X = H- T = H - (n-H) = 2H - n.$ Also, $E(X) = E(H-T) = E(H) - E(T) = n/2 - n/2 = 0.$
Then $Var(X) = Var(2H-n) = 4Var(H) = 4(n/4) = n = 10.$
Simulation with 10 million 10-toss sessions.
set.seed(2021)
n = 10;  p = 1/2
h = rbinom(10^7, n, p)
t = n-h;  x = h-t;
mean(x);  var(x)
[1] 0.0010386    # aprx E(X) = 0
[1] 10.00229     # aprx Var(X) = 10

summary(x)
      Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
 -10.000000  -2.000000   0.000000   0.001039   2.000000  10.000000 

hist(x, prob=T, br = (-11:10)+.5, col="skyblue2", 
     main="Simulated Dist'n of H - T")


A: $E[X] = \sum x \cdot P(x)$
The probability is as you seem to indicate, $${10 \choose h}(\frac{1}{2})^n \frac{1}{2}^{10-h} = \frac{{10 \choose h}}{2^{10}}$$
If you wanted the number of heads that should be multiplied by $h$ and summed.  As you want the number of heads minus tails, your first calculation is correct, $E[X] = 0$, which makes sense by symmetry anyway.
I repeated your calculation of $E[X^2]$ and got the same answer you did, which appears to be correct according to the other answers.
