7 races? That doesn't seem right.
Split the 25 horses into 5 arbitrary groups of 5. For each group, determine the fastest horse. Race each group. You now have 5 horses, each the fastest of their group. Race those 5 horses to determine the fastest horse overall - a total of 6 races.
EDIT: I misread the question statement, so the above answer is incorrect. Sorry about that. I would still encourage you to solve my question down below (it's easy and fun!), though it gets a little trickier when you want to know the j fastest horses instead of just the fastest :)
Another fun, but simple exercise:
Find a closed formula that will answer this question for an arbitrary number of horses k and an arbitrary number of racetracks n.
Hint: Look at cases where n divides k first :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
7 races? That doesn't seem right.
Split the 25 horses into 5 arbitrary groups of 5. For each group, determine the fastest horse. Race each group. You now have 5 horses, each the fastest of their group. Race those 5 horses to determine the fastest horse overall - a total of 6 races.
EDIT: I misread the question statement, so the above answer is incorrect. Sorry about that. I would still encourage you to solve my question down below (it's easy and fun!), though it gets a little trickier when you want to know the j fastest horses instead of just the fastest :)
But you need the top 3, not just the top 1.
Yes. Please read my post and learn from my silly mistakes :)
Another fun, but simple exercise:
Find a closed formula that will answer this question for an arbitrary number of horses k and an arbitrary number of racetracks n.
Hint: Look at cases where n divides k first :)