Along the road, there are 9 street lamps. If one of them burns out and the adjacent ones are still working, the road service is not concerned. However, if two lamps burn out in a row, the road service immediately replaces all the burnt-out lamps.

Each lamp burns out independently of the others.

a) Find the probability that exactly 4 lamps will need to be replaced during the next replacement.

b) Find the expected number of lamps that will need to be replaced during the next replacement.

#
We will solve the problem in the general case. Let's replace the burning lamp with a one and a burnt-out lamp with a zero. Then, initially, we have a row of $n$ ones, which sequentially and in random order turn into zeros.

a) After the first transformation, two zeros in a row cannot occur. Let's find the probability that after $k$ transformations the row does not have two zeros in a row. Such a row is called correct. The number of correct rows of length $n$ with exactly $k$ zeros is $C_{n-k+1}^{k}$ (see problem $\left.\underline{60403}\right)$.

Notice that during the transformations, $k$ zeros can arise in any order, and there are $k!$ such orders. Therefore, there are $C_{n-k+1}^{k} \cdot k!$ ways to obtain from the initial row of ones any correct row with $k$ zeros. On the other hand, the total number of rows of length $n$ with $k$ zeros is $C_{n}^{k}$, and thus there are $C_{n}^{k} k!$ ways to obtain any row with $k$ zeros through sequential transformations of ones into zeros.

All these ways are equally likely, so the probability $p_{k}$ that after $k$ transformations the resulting row will be correct is $\frac{C_{n-k+1}^{k}}{C_{n}^{k}}$. Now let's find the probability $p_{k}$ that two zeros in a row will appear exactly after $k$ transformations. For this, we need to subtract from the probability of obtaining a correct row with $k-1$ zeros the probability of obtaining a correct row with $k$ zeros. Thus, $p_{k}=r_{k-1}-r_{k}=\frac{C_{n-k+2}^{k-1}}{C_{n}^{k-1}}-\frac{C_{n-k+1}^{k}}{C_{n}^{k}}$. For $n=9, k=4$, we get: $p_{4}=\frac{C_{7}^{3}}{C_{9}^{3}}-\frac{C_{6}^{4}}{C_{9}^{4}}=\frac{5}{12}-\frac{5}{42}=\frac{25}{84} \approx 0.284$.

b) Let's find the expected number of lamps to be replaced. Clearly, this is the expected number of transformations of ones into zeros before two zeros in a row appear. Denote this random variable by $X$. $\mathrm{E} X=p_{1}+2 p_{2}+3 p_{3}+4 p_{4}+\ldots$ The summation should continue up to $k=\left[\frac{n+1}{2}\right]$: for $k>\left[\frac{n+1}{2}\right]$ all probabilities are zero. Thus, $\mathrm{E} X=\left(r_{0}-r_{1}\right)+2\left(r_{1}-r_{2}\right)+3\left(r_{2}-r_{3}\right)+\ldots=r_{0}+r_{1}+r_{2}+\ldots=\sum_{k=0}^{\left[\frac{n+1}{2}\right]} \frac{C_{n-k+1}^{k}}{C_{n}^{k}}$. The obtained expression is convenient to interpret using Pascal's triangle. The numerators form a diagonal, and the denominators form a horizontal line (see figure). Dividing the numerators by the corresponding denominators (in the same column), we sum the resulting quotients.

![](https://cdn.mathpix.com/cropped/2024_05_08_293b4772a418c01a5915g-27.jpg?height=517&width=952&top_left_y=1874&top_left_x=559)

For $n=9 \mathrm{E} X=\frac{1}{1}+\frac{9}{9}+\frac{28}{36}+\frac{35}{84}+\frac{15}{126}+\frac{1}{126}=\frac{837}{252} \approx 3.32$.

## Answer

a) $25 / 84 \approx 0.294$
b) $837 / 252 \approx 3.32$.