I'm a newbie in Probability. The book "Introduction to Probability" by Joseph K. Blitzstein and Jessica Hwang page 161 in the Expectation chapter in section Variance talks about Binomial Variance but also involve deriving the variance from using indicator random variables (I know there is other way of doing it but my question is about this specific method).
The book says: Alternatively, we can find $E(X^2)$ by first finding $E{X \choose 2}$. Since ${X \choose 2}$ is the number of pairs of successful trials. Creating an indicator r.v. for each pair of trials, we have: $$E{X \choose 2} = {n \choose 2}p^2$$
I understand this part that there is pairs of successful trial from all n trials so there are ${n \choose 2}$ of it and each with probability $p * p = p^2$
then it says:
Thus,
$$n(n-1)p^2 = E(X(X-1)) = E(X^2) - E(X) = E(X^2) - np $$ I do not understand why: $n(n-1)p^2 = E(X(X-1)) $ ???
I need not only word explanation but I also would like to know the mathematical step by step computation. please show it. It seems like it relates to Law of the unconscious statistician (LOTUS) but LOTUS talks about $E(g(X))$ but this problem is like E(g(X(something...))). please give word explanation and step by step mathematical computation. Does Linearity of Expectation also involve? but it only talks about E(cX) and E(X+Y) isn't it? in this case it is E(random variable(random variable)) ???