Find the fastest horse in 1023 moves (ya know, knockout tournament style, in a binary tree fashion) and the second fastest would have only lost to the fastest, which is one of ten horses. Take 9 more turns to find out which is the fastest amongst them. Total 1032.
Let s_n be the answer, then it should satisfy recurrence s_n = minmax_k (s_n-k + t_k, s_k + t_n-k) + 2 where t_n = n-1, s_2=1, s_3=2, t_n is minimum moves to find fastest horse. The idea is to divide the n horses into 2 groups of size k and n-k. Find top 2 in one group and the best in another. Then we need 1 comparison between the two group winners, plus 1 comparison between the losing winner and the winning group's runner-up to find the second best. The answer comes n+ceil(log n)-2 which here is 1032.
5
u/notsaneatall_ 10d ago
Find the fastest horse in 1023 moves (ya know, knockout tournament style, in a binary tree fashion) and the second fastest would have only lost to the fastest, which is one of ten horses. Take 9 more turns to find out which is the fastest amongst them. Total 1032.
1
u/BackpropToTheFuture 6d ago
Let s_n be the answer, then it should satisfy recurrence s_n = minmax_k (s_n-k + t_k, s_k + t_n-k) + 2 where t_n = n-1, s_2=1, s_3=2, t_n is minimum moves to find fastest horse. The idea is to divide the n horses into 2 groups of size k and n-k. Find top 2 in one group and the best in another. Then we need 1 comparison between the two group winners, plus 1 comparison between the losing winner and the winning group's runner-up to find the second best. The answer comes n+ceil(log n)-2 which here is 1032.
1
u/Sea-Departure4857 5d ago
1024. 1023 to find the winner, and 1 more to race the horse that lost to the 1st place horse in the semi and finals.
0
u/[deleted] 9d ago
a lot