Example. Two dice are thrown. Find the distribution of the random vector $(\xi, \eta)$ and the covariance of $\xi$ and $\eta$, where $\xi$ is the maximum of the numbers that appear, and $\eta$ is the number of times one appears.
Solution.

1. Determine the set of possible values of $(\xi, \eta)$.

Number the dice. An elementary outcome of the considered random experiment is an ordered pair of numbers $\left(n_{1}, n_{2}\right)$, where $n_{1}$ is the number of points that fell on the first die and $n_{2}$ on the second. On the elementary outcome $\left(n_{1}, n_{2}\right)$, the random vector $(\xi, \eta)$ takes the value $\left(\max \left(n_{1}, n_{2}\right), \chi_{\left\{n_{1}=1\right\}}+\chi_{\left\{n_{2}=1\right\}}\right)$, where for $i=1,2$

$$
\chi_{\left\{n_{i}=1\right\}}= \begin{cases}1, & \text { if } n_{i}=1 \\ 0, & \text { if } n_{i}=0\end{cases}
$$

We will construct a table of elementary outcomes and values of $(\xi, \eta)$:

| $n_{1}$ | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $n_{2}$ | 1 | 2 | 3 | 4 | 5 | 6 | 1 | 2 | 3 | 4 | 5 | 6 |
| $\xi$ | 1 | 2 | 3 | 4 | 5 | 6 | 2 | 2 | 3 | 4 | 5 | 6 |
| $\eta$ | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |


| $n_{1}$ | 3 | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 4 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $n_{2}$ | 1 | 2 | 3 | 4 | 5 | 6 | 1 | 2 | 3 | 4 | 5 | 6 |
| $\xi$ | 3 | 3 | 3 | 4 | 5 | 6 | 4 | 4 | 4 | 4 | 5 | 6 |
| $\eta$ | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |


| $n_{1}$ | 5 | 5 | 5 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 6 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $n_{2}$ | 1 | 2 | 3 | 4 | 5 | 6 | 1 | 2 | 3 | 4 | 5 | 6 |
| $\xi$ | 5 | 5 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
| $\eta$ | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |

From the table, we see that the random vector $(\xi, \eta)$ takes eleven values: $(1,2),(2,0),(2,1),(3,0),(3,1),(4,0),(4,1),(5,0)$, $(5,1),(6,0),(6,1)$

2. Determine the probabilities of the values $\left(a_{k}^{\prime}, a_{k}^{\prime \prime}\right)$ and enter them in the bottom row. Since the space of elementary outcomes is finite, we select all elementary outcomes that lead to a specific value of the random vector, and then sum the probabilities of these outcomes. To find, for example, the probability of the random event $\{(\xi, \eta)=(4,0)\}$, we need to select the favorable elementary outcomes. Clearly, these are $(2,4),(3,4),(4,2),(4,3)$, $(4,4)$. Since all elementary outcomes are equally likely, we have

$$
\mathrm{P}((\xi, \eta)=(4,0))=\frac{5}{36}
$$

Similarly, we need to find all other elements of the bottom row of the distribution. In the end, we get the distribution of the random vector $(\xi, \eta):$

| $\xi$ | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 | 5 | 6 | 6 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $\eta$ | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| $\mathrm{P}$ | $\frac{1}{36}$ | $\frac{1}{36}$ | $\frac{2}{36}$ | $\frac{3}{36}$ | $\frac{2}{36}$ | $\frac{5}{36}$ | $\frac{2}{36}$ | $\frac{7}{36}$ | $\frac{2}{36}$ | $\frac{9}{36}$ | $\frac{2}{36}$ |

3. Find $\mathrm{M} \xi, \mathrm{M} \eta$ and $\mathrm{M} \xi \eta$ using formulas (3). We get

$$
\begin{aligned}
\mathrm{M} \xi= & 1 \cdot \frac{1}{36}+2\left(\frac{1}{36}+\frac{2}{36}\right)+3\left(\frac{3}{36}+\frac{2}{36}\right)+4\left(\frac{5}{36}+\frac{2}{36}\right)+ \\
& +5\left(\frac{7}{36}+\frac{2}{36}\right)+6\left(\frac{9}{36}+\frac{2}{36}\right)=\frac{1}{36}(1+6+15+28+45+66)=\frac{161}{36}
\end{aligned}
$$

$$
\begin{aligned}
& \mathrm{M} \eta=1 \cdot 5 \cdot \frac{2}{36}+2 \cdot \frac{1}{36}=\frac{1}{3} \\
& \mathrm{M} \xi \eta=1 \cdot 2 \cdot \frac{1}{36}+2 \cdot 1 \cdot \frac{2}{36}+3 \cdot 1 \cdot \frac{2}{36}+4 \cdot 1 \cdot \frac{2}{36}+5 \cdot 1 \cdot \frac{2}{36}+6 \cdot 1 \cdot \frac{2}{36}= \\
& =\frac{1}{36}(2+2+3+4+5+6)=\frac{11}{18}
\end{aligned}
$$

4. Find the covariance $\operatorname{cov}(\xi, \eta)$ of the random variables $\xi$ and $\eta$ using formula (2):

$$
\operatorname{cov}(\xi, \eta)=\mathrm{M} \xi \eta-\mathrm{M} \xi \mathrm{M} \eta=\frac{11}{18}-\frac{161}{36} \cdot \frac{1}{3}=-\frac{95}{108}
$$

Answer. $\operatorname{cov}(\xi, \eta)=-95 / 108$.

Conditions of the problem. Two dice are rolled. Find the distribution of the random vector $(\xi, \eta)$ and the covariance of $\xi$ and $\eta$.

1. $\xi$ - the number of occurrences of two, $\eta$ - the number of occurrences of three.
2. $\xi$ - the number of occurrences of two, $\eta$ - the number of occurrences of a number divisible by three.
3. $\