Second-Fastest Horse with Limited Race Tracks
You have
000$ horses and want to rank their speeds, but you can only race them in heats. Each race uses one of $5$ identical tracks and can run at most $5$ horses at a time (one per lane), giving you only their relative finishing order within that heat -- no times. There is no other way to compare horses.
00$ races. Record each group's internal ranking.
What is the minimum number of races needed to identify the second-fastest horse among all
000$?
Hints
- Reduce it to the famous 25-horses problem: with $5$ lanes and only relative orderings, first race disjoint groups, then race the group winners.
- After you know the fastest horse $H$, the only horses that can be second are those that lost exclusively to $H$ -- anyone who lost to a non-champion is out by transitivity.
- Track every horse that finished directly behind $H$ in a race $H$ actually ran; with $5$ lanes there are at most $5$ such contenders, so one final heat decides second place.
Worked Solution
How to Think About It: This is the classic 25-horses puzzle scaled up. The structure is the same regardless of the herd size: you can only compare $5$ horses per race and you learn only their order. The trick is that finding the single fastest is cheap, but finding the runner-up requires reasoning about which horses could still possibly be second once you know the champion. The candidates for second place are sharply limited by transitivity: a horse that already lost to two others cannot be second.
Approach: Race in groups to get a champion, then assemble the short list of genuine contenders for second.
Formal Solution: With
000$ horses and $5$ lanes:
00$ groups of $5$ and race each: - Round 1 -- group races. Partition into
- Find the overall fastest. The fastest horse is the winner of some group, so it is among the