Solution. First, we find the number of all possible arrangements of passengers in the carriage, taking into account the restrictions stated in the problem (four passengers wish to sit facing the locomotive, and three - on the opposite bench). Let $A, B, C$ be passengers who are indifferent to where they sit. If $A$ sits facing the locomotive, then the four other passengers can sit in 5! ways (permutations of five elements) on the bench with him. The remaining passengers on the opposite bench can also sit in 5! ways. Therefore, if $A$ chooses the first bench, all passengers can sit in $(5!)^2$ ways. We will get the same number of ways if on the first bench is not $A$, but $B$ or $C$.

Thus, the number of all equally possible cases into which the certain event is divided is $3(5!)^2$.

The cases favorable to the occurrence of the event of interest will be those in which the two given passengers, for example $B$ and $C$, sit next to each other. This is only possible if $B$ and $C$ sit with their backs to the locomotive. There will be $5! \cdot 3! \cdot 2 \cdot 4$ such cases, so the desired probability is

$$
p=\frac{5! \cdot 3! \cdot 2 \cdot 4}{3(5!)^2}=\frac{2}{15}
$$
1496. In a railway carriage compartment, two sofas stand opposite each other, each with five seats. Out of ten passengers, four wish to sit facing the locomotive, and three wish to sit with their backs to it. What is the probability that the two passengers from the three who are indifferent about where they sit will end up sitting next to each other?