While driving along a main road, there are eight traffic lights. The probability that a light will be showing red when we arrive is 0.4. What is the probability that we will not encounter two consecutive stop signals?
Solution. Let's number the traffic lights from 1 to 8 in the direction of travel. If there are no two consecutive red signals, then the number of stop signs we encounter on our way can be at most 4. Let \(0 \leq p \leq 4\), and let \(a_{p}\) denote the number of possibilities where exactly \(p\) red signals occur, and no two of them are adjacent. The combined probability of the red signals occurring at \(p\) specified locations is \(0.4^{p}\), and the combined probability of the non-red signals occurring at the remaining \((8-p)\) locations is \(0.6^{8-p}\). Thus, the answer to the problem is:

\[
0.6^{8} a_{0} + 0.6^{7} \cdot 0.4^{1} a_{1} + 0.6^{6} \cdot 0.4^{2} a_{2} + 0.6^{5} \cdot 0.4^{3} a_{3} + 0.6^{4} \cdot 0.4^{4} a_{4}
\]

To this, we only need to determine the values of \(a_{i}\). We will solve this part of the problem generally. Let \(n\) be an integer greater than 1, and \(p\) be a natural number not greater than \(\frac{n}{2}\). Suppose

\[
1 \leq k_{1} < k_{2} < \ldots < k_{p} \leq n
\]

and no two of the \(k_{i}\) numbers are adjacent, i.e., \(k_{i+1} - k_{i} \geq 2\). Then

\[
1 \leq k_{1} < k_{2} - 1 < k_{3} - 2 < \ldots < k_{p} - (p-1) \leq n - p + 1
\]

and conversely: if \(1 \leq t_{1} < t_{2} < \ldots < t_{p} \leq n - p + 1\), then the numbers \(k_{1} = t_{1}, k_{2} = t_{2} + 1, k_{3} = t_{3} + 2, \ldots, k_{p} = t_{p} + p - 1\) do not contain any adjacent numbers. Therefore, \(a_{p}\) is the number of ways to choose \(p\) numbers from the set \(\{1, 2, \ldots, n - p + 1\}\), which is \(\binom{n - p + 1}{p}\). Based on this, the desired probability is

\[
0.6^{8} + 8 \cdot 0.6^{7} \cdot 0.4^{1} + 21 \cdot 0.6^{6} \cdot 0.4^{2} + 20 \cdot 0.6^{5} \cdot 0.4^{3} + 5 \cdot 0.6^{4} \cdot 0.4^{4} \approx 0.38
\]