Example 3. A discrete random variable $X$ has the distribution law

| $X$ | 0 | 1 | 2 | 3 |
| :---: | :---: | :---: | :---: | :---: |
| $P$ | 0.1 | 0.3 | 0.4 | 0.2 |

Find the distribution law of the random variable $Y=\sin \frac{\pi}{2} X+1$.
Solution. First, let's find the values of the function $Y=f(X)=\sin \frac{\pi}{2} X+1$.

For $x=0,1,2,3$, we get the numbers $1,2,1,0$ respectively. Therefore, the possible values of the random variable $Y$ are $y_{1}=0, y_{2}=1, y_{3}=2$. Let's calculate the probabilities of these values:

$$
\begin{aligned}
& P(Y=0)=P(X=3)=0.2 \\
& P(Y=1)=P(X=0)+P(X=2)=0.1+0.4=0.5 \\
& P(Y=2)=P(X=1)=0.3
\end{aligned}
$$

Thus, the function $Y=\sin \frac{\pi}{2} X+1$ has the distribution law

| $Y=\sin \frac{\pi}{2} X+1$ | 0 | 1 | 2 |
| :---: | :---: | :---: | :---: |
| $P$ | 0.2 | 0.5 | 0.3 |