704. Find by the method of superposition explicit formulas for the generation of a continuous random variable $X$, given by the distribution function $F(x)=1-(1 / 3)\left(2 \mathrm{e}^{-2 x}+\right.$ $\left.+\mathrm{e}^{-3 x}\right)(0<x<\infty)$.
Solution. According to rule 3, we represent the given function as

$$
F(x)=(1 / 3)\left(1-e^{-3 x}\right)+(2 / 3)\left(1-e^{-2 x}\right)
$$

The functions enclosed in parentheses are distribution functions of the exponential law, so we can assume: $F_{1}(x)=1-\mathrm{e}^{-3 x}$, $F_{2}(x)=1-\mathrm{e}^{-2 x}, C_{1}=1 / 3, C_{2}=2 / 3$.

Let's introduce an auxiliary discrete random variable $Z$ with the distribution law

| $Z$ | 1 | 2 |
| :---: | :---: | :---: |
| $p$ | $1 / 3$ | $2 / 3$ |

Choose independent random numbers $r_{1}$ and $r_{2}$. Play out $Z$ using the random number $r_{1}$, for which, according to rule § 1, we construct partial intervals $\Delta_{1}-(0,1 / 3)$ and $\Delta_{2}-(1 / 3,1)$. If $r_{1}<1 / 3$, then $Z=1$; if $r_{1} \geqslant 1 / 3$, then $Z=2$.

Thus, the possible value of $X$ is found by solving the equation for $x$

$$
1-\mathrm{e}^{-3 x}=r_{2}, \text { if } r_{1}<\frac{1 / 3}{},
$$

or

$$
1-\mathrm{e}^{-2 x}=r_{2}, \text { if } r_{1} \geqslant 1 / 3 .
$$

Solving these equations, we get:

$$
\begin{aligned}
& x=\left[-\ln \left(1-r_{2}\right)\right] / 3, \text { if } r_{1}<1 / 3 ; \\
& x=\left[-\ln \left(1-r_{2}\right)\right] / 2, \text { if } r_{1} \geqslant 1 / 3 .
\end{aligned}
$$

Considering that the random variables $R$ and $1-R$ are identically distributed in the interval (0,1), we finally have simpler formulas:

$$
\begin{aligned}
& x=\left(-\ln r_{2}\right) / 3, \text { if } r_{1}<1 / 3, \\
& x=\left(-\ln r_{2}\right) / 2, \text { if } r_{1} \geqslant 1 / 3 .
\end{aligned}
$$