Recall that X2 is simply the composition of the function X and the function ·2, denote Y:=X2 so that Y may only take on values 1 and 4 and also P(Y=4)=P((X=2)∪(X=−2))=P(X=2)+P(X=−2)=0.2+0.3=0.5 and for all other values P(Y=a)=0 E(X2)=E(Y)=4·0.5+1·0.5=2+.5=2.5 on the other hand E(X)=−2·0.2+1·0.5+2·0.3=0.7 so that E(X)2=0.49 so E(X)2≠E(X2)