1643. Given two independent random variables: $X$ - the number of heads appearing in 2 tosses of a five-kopeck coin, and $Y$ - the number of points that appear when rolling a die. Find the distribution law of the difference of these two random variables $X-Y$, the mathematical expectations and variances of the random variables $X, Y, X-Y$, and verify that $E(X-Y)=E X-E Y$ and $D(X-Y)=D X+D Y$.
Solution. Since the random variable $X$ takes the value $m$ with probability $P_{m 2}=C_{2}^{m} p^{m} q^{2-m}$ (Bernoulli's formula),
where $m=0,1,2$ and $p=0.5$, the distribution table of this random variable is

| $x$ | 0 | 1 | 2 |
| :---: | :---: | :---: | :---: |
| $p(x)$ | $\frac{1}{4}$ | $\frac{1}{2}$ | $\frac{1}{4}$ |

From this,

$$
E X=0 \cdot \frac{1}{4}+1 \cdot \frac{1}{2}+2 \cdot \frac{1}{4}=1
$$

$D X=E(X-E X)^{2}=E(X-1)^{2}=(0-1)^{2} \cdot \frac{1}{4}+(1-1)^{2} \cdot \frac{1}{2}+$ $+(2-1)^{2} \cdot \frac{1}{4}=0.5$

The distribution table of the random variable $Y$ is:

| $y$ | 1 | 2 | 3 | 4 | 5 | 6 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $p(y)$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ |

Then

$$
\begin{aligned}
& E Y=1 \cdot \frac{1}{6}+2 \cdot \frac{1}{6}+3 \cdot \frac{1}{6}+4 \cdot \frac{1}{6}+5 \cdot \frac{1}{6}+6 \cdot \frac{1}{6}=3.500 \\
& D Y=(1-3.5)^{2} \cdot \frac{1}{6}+(2-3.5)^{2} \cdot \frac{1}{6}+(3-3.5)^{2} \cdot \frac{1}{6}+(4- \\
& \quad-3.5)^{2} \cdot \frac{1}{6}+(5-3.5)^{2} \cdot \frac{1}{6}+(6-3.5)^{2} \cdot \frac{1}{6}=2.917
\end{aligned}
$$

To obtain the distribution of $X-Y$, we will construct the following table, which will give the various possible cases: $X=$ $=x_{i}, Y=y_{j}$, the probabilities of these cases: $P\left(X=x_{i}, Y=y_{j}\right)=$ $=P\left(X=x_{i}\right) P\left(Y=y_{j}\right)$ (the random variables are independent) and the values of $X-Y$ in each of them:

| Various  possible  cases | $X=x_{i}$ | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|  | $Y=y_{j}$ | 1 | 2 | 3 | 4 | 5 | 6 | 1 | 2 | 3 |
| Probabilities  of these cases | $P\left(X=x_{i}, Y=y_{j}\right)$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{12}$ | $\frac{1}{12}$ | $\frac{1}{12}$ |
| Values  of  $X-Y$ | $x_{i}-y_{j}$ | -1 | -2 | -3 | -4 | -5 | -6 | 0 | -1 | -2 |

Continuation

| Various  possible  cases | $X=x_{i}$ | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|  | $Y=y_{j}$ | 4 | 5 | 6 | 1 | 2 | 3 | 4 | 5 | 6 |
| Probabilities  of these cases | $P\left(X=x_{i}, Y=y_{j}\right)$ | $\frac{1}{12}$ | $\frac{1}{12}$ | $\frac{1}{12}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ | $\frac{1}{24}$ |
| Values  of  $X-Y$ | $x_{l}-y_{j}$ | -3 | -4 | -5 | 1 | 0 | -1 | -2 | -3 | -4 |

We notice that $X-Y$ sometimes takes the same value in different cases. Using the addition theorem of probabilities, we combine these cases into one (the random variable $X-Y$ takes a given value). Then we get the following distribution table of the random variable $X-Y$:

| -6 | -5 | -4 | -3 |
| :---: | :---: | :---: | :---: | :---: |
| $\frac{1}{24}$ | $\frac{1}{24}+\frac{1}{12}$ | $\frac{1}{24}+\frac{1}{24}+\frac{1}{12}$ | $\frac{1}{24}+\frac{1}{12}+\frac{1}{24}$ |
|  |  |  |  |
| -2 | -1 | 0 | 1 |
| $\frac{1}{24}+\frac{1}{12}+\frac{1}{24}$ | $\frac{1}{24}+\frac{1}{12}+\frac{1}{24}$ | $\frac{1}{12}+\frac{1}{24}$ | $\frac{1}{24}$ |

or

| -6 | -5 | -4 | -3 | -2 | -1 | 0 | 1 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $\frac{1}{24}$ | $\frac{1}{8}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{8}$ | $\frac{1}{24}$ |

From this,

$$
\begin{aligned}
E(X-Y)= & -6 \cdot \frac{1}{24}+(-5) \cdot \frac{1}{8}-4 \cdot \frac{1}{6}-3 \cdot \frac{1}{6}-2 \cdot \frac{1}{6}- \\
& -1 \cdot \frac{1}{6}+0 \cdot \frac{1}{8}+1 \cdot \frac{1}{24}=-2.5
\end{aligned}
$$

We check property 3 of the mathematical expectation: $E(X-Y)=$ $=E X-E Y$.

It holds: $-2.5=1-3.5=-2.5$. Then

$$
\begin{aligned}
& D(X-Y)=(-6+2.5)^{2} \cdot \frac{1}{24}+(-5+2.5)^{2} \cdot \frac{1}{8}+(-4+ \\
& +2.5)^{2} \frac{1}{6}+(-3+2.5)^{2} \cdot \frac{1}{6}+(-2+2.5)^{2} \cdot \frac{1}{6}+(-1+ \\
& \quad+2.5)^{2} \cdot \frac{1}{6}+(0+2.5)^{2} \cdot \frac{1}{8}+(1+2.5)^{2} \cdot \frac{1}{24}=3.417 .
\end{aligned}
$$

We check property 3 of the variance: $D(X-Y)=D X+D Y$. It also holds: $3.417=0.5+2.917=3.417$.