# How do I calculate the expectation value and variance?

Two distinct cubes are thrown. The random variable X identifies the difference, that is the amount of the difference in the number of the eyes. Calculate the expectation value and variance.

$E\left ( X \right )=$

$V\left ( X \right )=$

Note: Enter the result to a minimum of 6 commas, or exactly.

$E\left ( X \right )=$Solution is $(35/18)$

$V\left ( X \right )=$Solution is $(63005/23328)$

Can someone give me some directions?

• Each cube can give you 1 to 6, all with probability 1/6. For two cubes, that makes 36 possible combinations. Not all give the an individual difference, in fact the difference (I assume it's the magnitude of the difference) is between 0 (same number on both) and 5 (one shows 1, the other 6). For each of these values, work how often they can occur. This gives you the probability ($n/36$). Once you have all 6 probabilities, $E(X) = \sum x_i p(X=x_i)$ and $V(X) = E(X^2)-E(X)^2$. – Florian Dec 23 '16 at 15:16
• List all the possibilities where there is 0 difference. List all the possibilities where there is 1 difference. List... You get the probability that when you throw two dice, the difference is X. Calculating everything else is straightforward. – Kaynex Dec 23 '16 at 15:18

X = difference of the numbers on two cubes.

P(X=0) = P({1,1},{2,2},.....,{6,6}) = $\frac{6}{36}$

P(X=1) = P({1,2},{2,3},.....,{5,6},{6,5},.....) = $\frac{10}{36}$

P(X=2) = P({1,3},{2,4},{3,5}....,{4,6},{6,4},.....) = $\frac{8}{36}$

P(X=3) = P({1,4},{2,5},{3,6},{4,1},....) = $\frac{6}{36}$

P(X=4) = P({1,5},{2,6}{5,1},{6,2}) = $\frac{4}{36}$

P(X=5) = P({1,6},{6,1}) = $\frac{2}{36}$

Mean = Sum of $P_{i}.X_{i}$

Mean = $0 \times \frac{6}{36} + 1 \times \frac{10}{36} + 2 \times \frac{8}{36} + 3 \times \frac{6}{36} + 4 \times \frac{4}{36} + 5 \times \frac{2}{36}$

= $0 + \frac{10}{36} + \frac{16}{36} + \frac{18}{36} + \frac{16}{36} + \frac{10}{36}$

= $\frac{70}{36}$ = $\frac{35}{18}$

$\text{Variance} = \text{Sum of } P_{i} \cdot X_{i}^2 - \text{Mean}^2$

You have all values. Hope you can now do it.

• Thanks! I tried to calculate V, but I can't get correct result. Can you tell me where is my mistake? $V(X)=\frac{6}{36} \cdot 0^2+\frac{10}{36} \cdot 1^2+\frac{8}{36} \cdot 2^2+\frac{6}{36} \cdot 3^2+\frac{4}{36} \cdot 4^2+\frac{2}{36} \cdot 5^2-\left(\frac{35}{18} \right)^2=\frac{210}{36}-\frac{1225}{324}=\frac{665}{324}$ – ayra Dec 23 '16 at 21:25
• Your answer is correct. Maybe in book answer is misprinted. – Kanwaljit Singh Dec 24 '16 at 6:06

Let $X_1, X_2$ be the values of the two die, so that $X=\lvert X_1-X_2\rvert$. Then by symmetry:

\begin{align}\mathsf E(X) & = \mathsf E(\lvert X_1-X_2\rvert) \\[1ex] & = 2~\mathsf E\bigl((X_1-X_2)\mathbf 1_{ X_1>X_2}\bigr)\\[1ex]& = \frac{2}{36}\sum_{x=2}^6\sum_{y=1}^{x-1}(x-y) \end{align}

On the other hand, by the identicality and independence of the distributions:

\begin{align}\mathsf E(X^2) & = \mathsf E(X_1^2-2X_1X_2+X_2^2) \\[1ex] & = 2~\bigl(\mathsf E(X_1^2)-\mathsf E(X_1)^2\bigr)\\[1ex]& = 2~\mathsf {Var}(X_1) \end{align}