When a die is rolled, the outcomes are: 1, 2, 3, 4, 5, or 6
Odd numbers (1, 3, 5) give X=1
Even numbers (2, 4, 6) give X=−1
Out of 6 possible outcomes:
3 are odd, so P(X=1)=63=21
3 are even, so P(X=−1)=63=21
The expected value is:
E(X)=(1)×21+(−1)×21
E(X)=21−21
E(X)=0
The expected value of X2 is:
E(X2)=(1)2×21+(−1)2×21
E(X2)=1×21+1×21
E(X2)=21+21
E(X2)=1
Using the variance formula:
Var(X)=E(X2)−[E(X)]2
Var(X)=1−(0)2
Var(X)=1−0
Var(X)=1
Therefore, the variance of X is 1.