Confusion on a random variance theorem

110 Views Asked by At

I'm confused on how $E(X)^2\sum_{s∈S}p(s) = E(X)^2$ because $E(X) = \sum_{s∈S}p(s)X(s)$. Wouldn't $E(X)^2=(\sum_{s∈S}p(s)X(s))^2$?enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

Comment: For $S$ finite or countable,

$\sum_{s \in S} p(s) = 1.$ So $E(X)^2\sum_{s∈S}p(s) = E(X)^2 \times (1) = E(X)^2.$ You seem to be confusing $E(X)^2 = [E(X)]^2$ with $E(X^2).$

$E(X) = \sum_{s \in S} X(s)p(s),$ as you say, provided the sum converges absolutely.

$E(X^2) = \sum_{s \in S} X^2(s)p(s).$

In general, one does $not$ have $E(X^2)$ equal to $[E(X)]^2.$

Example. Let $X \sim Binom(n = 3, p = 1/2).$

Possibly illuminating session in R:

 n = 3;  p = 1/2;  x = 0:n;  pdf = dbinom(x, n, p)
 tabl = cbind(x, pdf, prod.1=x*pdf, prod.2=x^2*pdf);  tabl

 ## x   pdf prod.1 prod.2           
 ## 0 0.125  0.000  0.000
 ## 1 0.375  0.375  0.375
 ## 2 0.375  0.750  1.500
 ## 3 0.125  0.375  1.125
 colSums(tabl)
 ##   x pdf prod.1 prod,2        
 ## 6.0 1.0    1.5    3.0 

 sum(pdf)
 ## 1
 mu = sum(x * pdf);  mu
  1.5  # E(X)
 n*p
 ## 1.5

 vr = sum((x - mu)^2 * pdf);  vr
 0.75  # V(X)
 n * p * (1-p)
 ## 0.75

 vr.2 = sum(x^2 * pdf) - mu^2;  vr.2
 ## 0.75  # V(X) = E(X^2) - mu^2