6. Players $A$ and $B$ play the following game on a board consisting of six fields numbered $1,2, \ldots, 6$. At the beginning, a figure is placed on the field numbered 2, and then a regular die is rolled. If a number divisible by three is rolled, the figure moves to the field with a number one less, otherwise to the field with a number one greater. The game ends with a victory for player $A$ or $B$ if the figure reaches the field numbered 1 or 6, respectively. With what probability will player $A$ win?
SOLUTION. Let's first solve an easier problem. Play the same game, but on a board composed of four squares marked with the numbers $1,2,3,4$, where $B$ wins if the piece ends up on the square numbered 4. The probability that player $A$ wins immediately on the first move is $\frac{1}{3}$. With a probability of $\frac{2}{3}$, the piece will land on square number 3. Then, with a probability of $\frac{2}{3}$, player $B$ wins, and with a probability of $\frac{1}{3}$, the piece lands on square number 2. At this point, we have returned to the initial position. Let's summarize what actually happened.

Player $A$ won with a probability of $\frac{1}{3}$.

Player $B$ won with a probability of $\frac{2}{3} \cdot \frac{2}{3}=\frac{4}{9}$.

We returned to the initial position with a probability of $\frac{2}{3} \cdot \frac{1}{3}=\frac{2}{9}$.

It is clear that after another two moves, we will have the following balance:

Player $A$ won with a probability of $\frac{1}{3}+\frac{2}{9} \cdot \frac{1}{3}$.

Player $B$ won with a probability of $\frac{4}{9}+\frac{2}{9} \cdot \frac{4}{9}$.

We returned to the initial position with a probability of $\frac{2}{9} \cdot \frac{2}{9}$.

By repeating this process, we get that player $A$ wins with a probability of

$$
\begin{aligned}
\frac{1}{3}+\frac{2}{9} \cdot \frac{1}{3}+\left(\frac{2}{9}\right)^{2} \cdot \frac{1}{3}+\left(\frac{2}{9}\right)^{3} \cdot \frac{1}{3}+\ldots & =\frac{1}{3}\left(1+\frac{2}{9}+\left(\frac{2}{9}\right)^{2}+\left(\frac{2}{9}\right)^{2}+\ldots\right)= \\
& =\frac{1}{3} \frac{1}{1-\frac{2}{9}}=\frac{3}{7}
\end{aligned}
$$

We used the formula for the sum of a geometric series. We found that player $A$ wins with a probability of $\frac{3}{7}$. By a similar process, we get that player $B$ wins with a probability of $\frac{4}{7}$. From this, it follows that the probability of a draw is 0.

Now consider the same game played on a board with five squares. In this case, player $A$ wins on the first move with a probability of $\frac{1}{3}$ and with a probability of $\frac{2}{3}$, the piece lands on square number 3. Notice that square number 3 is in the center of the board. Intuitively, it is clear that at this point, player $B$ will win with a probability four times greater than player $A$. This means that player $A$ wins with a probability of $\frac{1}{5}$ and player $B$ with a probability of $\frac{4}{5}$. Let's try to prove this.

Consider any sequence of moves of the piece from square 3 such that it ends on square 1. Write it using the letters $P$ and $L$ depending on whether we moved to the right or to the left, for example, $P L L P L L$. Consider another sequence of moves such that each letter $P$ is replaced by the letter $L$ and vice versa. In our case, this means $L P P L P P$. We have obtained a sequence of moves that will end the piece on square 5. It is also clear that the number of letters $L$ is two more than the number of letters $P$ in the first case, and in the second case, the number of letters $L$ is two less than the number of letters $P$. From this, it follows that the probability of the first path is four times less than the probability of the second path. Since such an assignment of paths to each other is one-to-one, we get that the probability of player $B$ winning is four times greater than the probability of player $A$ winning.

Finally, we get that the probability of player $A$ winning is $\frac{1}{3}+\frac{2}{3} \cdot \frac{1}{5}=\frac{7}{15}$.

Let's solve the game on five squares in the same way as the game on four squares.

Player $A$ wins on the first move with a probability of $\frac{1}{3}$ and with a probability of $\frac{2}{3}$, the piece moves to square number 3. At this point, player $A$ wins after the next two moves with a probability of $\frac{1}{3} \cdot \frac{1}{3}=\frac{1}{9}$, player $B$ with a probability of $\frac{2}{3} \cdot \frac{2}{3}=\frac{4}{9}$, and the piece returns to square number 3 with a probability of $\frac{1}{3} \cdot \frac{2}{3}+\frac{2}{3} \cdot \frac{1}{3}=\frac{4}{9}$.

Thus, after at most four moves, player $A$ wins with a probability of

$$
\frac{1}{3}+\frac{2}{3} \cdot \frac{1}{9}
$$

After at most six moves, player $A$ wins with a probability of

$$
\frac{1}{3}+\frac{2}{3} \cdot \frac{1}{9}\left(1+\frac{4}{9}\right)
$$

By repeating this process, we find that player $A$ wins with a probability of

$$
\frac{1}{3}+\frac{2}{3} \cdot \frac{1}{9}\left(1+\frac{4}{9}+\left(\frac{4}{9}\right)^{2}+\left(\frac{4}{9}\right)^{3} \ldots\right)
$$

In the parentheses, we have the sum of a geometric series with a common ratio of $\frac{4}{9}$. After simplification, we get that player $A$ wins with a probability of

$$
\frac{1}{3}+\frac{2}{3} \cdot \frac{1}{9} \cdot \frac{1}{1-\frac{4}{9}}=\frac{7}{15}
$$

Similarly, we can prove that player $B$ wins with a probability of $\frac{8}{15}$. This means that the probability of a draw is 0.

Finally, let's solve the given problem. Let $p_{i}$ be the probability that player $A$ wins, given that the piece is on the $i$-th square. We get the system of equations

$$
\begin{aligned}
p_{2} & =\frac{1}{3}+\frac{2}{3} p_{3} \\
p_{3} & =\frac{1}{3} p_{2}+\frac{2}{3} p_{4} \\
p_{4} & =\frac{1}{3} p_{3}+\frac{2}{3} p_{5} \\
p_{5} & =\frac{1}{3} p_{4}
\end{aligned}
$$

By substituting from one equation into another, we get the solution $p_{2}=\frac{15}{31}$. Since the piece starts on square number 2, the probability of player $A$ winning is $\frac{15}{31}$. Similarly, we can set up and solve the system of equations for player $B$ and get that player $B$ wins with a probability of $\frac{16}{31}$. The probability of a draw is again 0. This completes the solution of the problem.