Example. An unlimited number of Bernoulli trials are conducted with the probability of success $p$. Find the probability that the first success will occur on the $n$-th trial, and the second success - after the $m$-th trial $(m>n)$.
Solution. The given event is caused by "chains" N...NUN...NU, where the first series of symbols N consists of the $(n-1)$-th element, and the second series consists of $k$ elements, where $k \geqslant m-n$. The probability of such a chain is $q^{n-1} p q^{k} p$, so the desired probability is

$$
\sum_{k=m-n}^{+\infty} q^{n+k-1} p^{2}=p^{2}\left(q^{m-1}+q^{m}+\ldots\right)=\frac{p^{2} q^{m-1}}{1-q}=p q^{m-1}
$$

Answer. $p q^{m-1}$.

Conditions of the Problem. An unlimited number of Bernoulli trials are conducted with the probability of success $p$. Find the probability of the specified random event.

1. The first success will occur on the $n$-th trial.
2. The first success will occur after the $n$-th trial.
3. A series of two consecutive successes will occur before a series of two consecutive failures.
4. A series of two consecutive successes will occur before a series of a success followed by a failure.
5. Before the moment of the $n$-th success, there will be exactly $m$ failures.
6. Before the moment of the $n$-th success, there will be at least $m$ failures.
7. The first and second successes will occur consecutively.
8. The first success will occur before the $n$-th trial, and the second after it.
9. The second success will occur on the $n$-th trial.
10. Between the first and second successes, there will be $n$ trials.

Answers. 1. $p q^{n-1}$. 2. $q^{n}$. 3. $p^{2}(1+q) /(1-p q)$. 4. $p$. 5. $C_{n+m-1}^{m} p^{n} q^{m}$. 6. $1-\sum_{k=0}^{m-1} C_{n+k+1}^{k} p^{n} q^{k}$. 7. $p$. 8. $(n-1) p q^{n-1}$. 9. $(n-1) p^{2} q^{n-2}$. 10. $p q^{n}$.

## 6.9. Large Number of Bernoulli Trials: Moivre-Laplace and Poisson Formulas

Problem Statement. A large number of Bernoulli trials are conducted. Find the probability of a certain event related to the total number of successes.

Plan of Solution. Let $n$ be the number of Bernoulli trials and $p$ be the probability of success in one trial, $q=1-p$. If $n$ is large, then using the Bernoulli formula $C_{n}^{k} p^{k} q^{n-k}$ for the probability of $k$ successes will require cumbersome calculations, and the result of these calculations will likely be incorrect due to rounding errors. Therefore, approximate formulas for $C_{n}^{k} p^{k} q^{n-k}$ should be used. These include the Moivre-Laplace formulas

$$
\begin{gathered}
C_{n}^{k} p^{k} q^{n-k} \approx \frac{1}{\sqrt{n p q}} \frac{1}{\sqrt{2 \pi}} e^{-x^{2} / 2}, \quad x=\frac{k-n p}{\sqrt{n p q}} \\
\sum_{k=k_{1}}^{k_{2}} C_{n}^{k} p^{k} q^{n-k} \approx \frac{1}{\sqrt{2 \pi}} \int_{x_{1}}^{x_{2}} e^{-u^{2} / 2} d u
\end{gathered}
$$

where $x_{1}=\left(k_{1}-n p\right) / \sqrt{n p q}$ and $x_{2}=\left(k_{2}-n p\right) / \sqrt{n p q}$, and the Poisson formulas

$$
\begin{aligned}
& C_{n}^{k} p^{k} q^{n-k} \approx \frac{a^{k}}{k!} e^{-a}, \quad a=n p \\
& \sum_{k=k_{1}}^{k_{2}} C_{n}^{k} p^{k} q^{n-k} \approx \sum_{k=k_{1}}^{k_{2}} \frac{a^{k}}{k!} e^{-a}
\end{aligned}
$$

The relative error of formulas (1) and (2) is approximately

$$
\frac{2(k-n p)}{n p q}+\frac{1+p q}{10 n p q}
$$

Therefore, formulas (1) and (2) are applicable when

$$
n p q \gg 1, \quad k \approx n p
$$

The relative error of formulas (3) and (4) is

$$
\max \left\{k p, \frac{k^{2}}{n-k}+\frac{n p^{2}}{q}\right\}
$$

Therefore, formulas (3) and (4) are applicable when

$$
n \gg k^{2}, \quad n p^{2} \ll 1, \quad k p \ll 1
$$

Obviously, formulas (3) and (4) relate to rare events ($p$ and $k$ are small).

1. Choose an approximate formula for calculating $C_{n}^{k} p^{k} q^{n-k}$. For this, determine whether conditions (5) or conditions (6) are met. If $p$ and $k$ are small, start the check with conditions (6); otherwise, start with conditions (5).
2. Find the approximate value of $C_{n}^{k} p^{k} q^{n-k}$. In the case where formulas (1) and (2) are applicable, use tables of values of the functions $*$ )

$$
\varphi(x)=\frac{1}{\sqrt{2 \pi}} e^{-x^{2} / 2} \quad \text { and } \quad \Phi(x)=\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{x} e^{-u^{2} / 2} d u
$$

Then

$$
\frac{1}{\sqrt{2 \pi}} \int_{x_{1}}^{x_{2}} e^{-u^{2} / 2} d u=\Phi\left(x_{2}\right)-\Phi\left(x_{1}\right)
$$

In the case where formulas (3) and (4) are applicable, use tables of values of the functions

$$
p_{a}(k)=\frac{a^{k}}{k!} e^{-a} \quad \text { and } \quad P_{a}(m)=\sum_{k=0}^{m} \frac{a^{k}}{k!} e^{-a} .
$$

Then

$$
\sum_{k=k_{1}}^{k_{2}} \frac{a^{k}}{k!} e^{-a}=P_{a}\left(k_{2}\right)-P_{a}\left(k_{1}\right)
$$

3. Calculate the error of the used approximate formula.
4. Round the obtained probability value taking into account the found error.

*) Using unified notation and names for the functions $\varphi(x)$ and $\Phi(x)$, different authors define them with different formulas.