A cube has an ant sitting at each of its vertices. At a given moment, each of them starts to move along a randomly chosen edge, and crosses over to the adjacent vertex. What is the probability that two ants will meet either on the way or at the end of the journey?
Solution. To determine the probability, we need to know how many ways the ants can move and out of these, in how many cases they meet. The total number of cases is easy to determine: each ant can move in 3 directions, and there are 8 ants, which gives $3^{8}$ possibilities. Counting the number of cases where the ants meet seems quite hopeless. In such cases, it can help to determine the number of other possibilities, that is, now the number of cases where the ants do not meet.

If the ants do not meet at the end of their path, it means that there will be one ant at each vertex again. If we marked with arrows where the ants are going from, then one arrow would start from each vertex, and one arrow would point to each vertex. We also know that two ants do not move towards each other, so at most one arrow can run along an edge. From all this, it follows that the "movement" of the ants will define one or more closed paths (loops) of length greater than two. On the cube, this can only happen if there are two 4-length loops or one 8-length loop.
![](https://cdn.mathpix.com/cropped/2024_05_02_49333fed239d638b88bbg-1.jpg?height=184&width=460&top_left_y=640&top_left_x=824)

An 8-length loop is uniquely determined by the two opposite faces on which there are 2 arrows each, and by which two edges these arrows run on. The movement can occur in two directions, so this gives $3 \cdot 2 \cdot 2=12$ possibilities so far.

The selection of two 4-length loops also has $3 \cdot 2 \cdot 2=12$ possibilities, since the two loops can be chosen in 3 ways from the two opposite faces, and the movement can occur in 2 directions for each loop.

In total, the ants do not meet in 24 cases, so the desired probability is $\frac{3^{8}-24}{3^{8}} \approx 0.9963$.