Problem

Source: BxMO 2022, Problem 2

Tags: BxMO, combinatorics



Let $n$ be a positive integer. There are $n$ ants walking along a line at constant nonzero speeds. Different ants need not walk at the same speed or walk in the same direction. Whenever two or more ants collide, all the ants involved in this collision instantly change directions. (Different ants need not be moving in opposite directions when they collide, since a faster ant may catch up with a slower one that is moving in the same direction.) The ants keep walking indefinitely. Assuming that the total number of collisions is finite, determine the largest possible number of collisions in terms of $n$.