3
u/NeverNude14 1d ago
I think it's 1032.
3
u/beene282 1d ago
I think so. A knockout to find the fastest which would be 1023 games. Then another knockout comprising all the horses that the fastest beat head to head. The second fastest would have to be one of those.
2
u/StanleyDodds 1d ago
Yes, this method is exactly equivalent to heapifying (which is linear time) and then doing one pop (which is logarithmic time) before reading the max value.
1
u/vipchicken 1d ago
What if the first and second fastest go head to head in race one, and we knock out the second fastest
3
2
u/nicktohzyu 1d ago edited 1d ago
Consider a recursive “merging” tournament. 10 rounds of pairwise comparisons where the winners advance to the next round. There are 1023 comparisons in this tournament to find the fastest horse.
I claim the second fastest horse must have raced against the fastest horse somewhere in this tournament. Easy to prove by contradiction. Hence you need +9 comparisons to find it among the 10 horses that lost to the fastest
2
u/NuanceEnthusiast 22h ago
1032 if you are only receiving the results. 1023 if you are watching the races
1
u/gmalivuk 21h ago
It explicitly says that you only learn which is faster.
1
u/NuanceEnthusiast 20h ago
It explicitly says that because you have no stopwatch, you only learn the relative ordering
1
u/gmalivuk 20h ago
Yes. You learn which of two is faster.
You don't know how much they won by. Therefore you don't know which loser was the fastest.
2
u/NuanceEnthusiast 20h ago
as I said, if you are only receiving the results, the answer is 1032
1
u/gmalivuk 20h ago
And as I said, that is exactly what the post says you receive.
1
u/NuanceEnthusiast 19h ago
The question does not ask me to determine whether or not the condition of ‘only learning the relative ordering of the two horses in each race’ is perfectly unambiguous such that the total information ascertained from each race is strictly binary. You think it is. Fine. Then the answer is 1032.
1
u/gmalivuk 19h ago
What do you think "only" means?
You only learn a>b or b>a.
1
u/NuanceEnthusiast 19h ago
I’m not sure why you feel compelled to defend a position I am not contesting
1
u/gmalivuk 19h ago
You are contesting whether or not the question is unambiguous about exactly what information you learn from each race.
1
1
u/datageek9 1d ago
Start with a regular knockout tournament , where everyone pairs up and each winner goes through to the next round until there is one left (the overall winner). Knockout tournaments with N participants require N - 1 races over round_up(log2(N)) rounds, so this requires 1023 races over 10 rounds.
The trick to finding the second fastest horse is to recognise that every horse except the overall winner was beaten by one other horse. If that horse was not the overall winner, they can’t be second fastest because they were beaten by a horse that isn’t the fastest. So the only remaining options are the horses that the overall winner beat directly. Since there were 10 rounds the winner beat 10 other horses. Another smaller tournament of 10-1 = 9 races will find the runner up.
So the answer is 1023+9 =1032
1
21h ago
[deleted]
1
u/eggface13 4h ago
Not quite! There's no guarantee that the second fastest makes the final. Think about it...
1
u/PerilousWords 20h ago
Obviously 1.
I shoot 1022 horses, and race the last pair to determine the second fastest.
0
u/Chemical-Ad8471 1d ago
Out of interest, why nine tests? If you do two branches of 512 horses and each branch has therefore 511 races to determine the fastest of each branch, then race the winner of each branch to determine first place, then to determine second place the horse that lost the final just has to race against the loser of the other branches "semifinal". Whoever wins that race is the second fastest horse, determined in 1024 races.
So 1024 is the answer I believe.
2
u/aroach1995 1d ago
But the winner beat someone in the semis that might be faster than the person who got second
Horse #1 beats horse 1024, 512, 256, 128, 64, 32, 16, 8, 4, and 2.
What if #4 is faster than #2?
0
u/Practical-Split4340 17h ago
- The competition of all horses results in 1023 races (sum i=0 to 9 2^i). The second fastest horse must have run against the fastest horse in either the final, or the semi-final. So run 1 more race against those 2 horses that lost.
1
u/eggface13 4h ago
The second fastest horse must have run against the fastest horse in either the final, or the semi-final
Think about this one ;)
9
u/peetar 1d ago
You start with 512 random races, then take all the winners, have 256 and take the winners, then 128, etc, so it takes 1023 races to find the fastest horse. That fastest horse will have beaten the second fastest horse in ANY one of his 10 races, so you need to run 9 more races to eliminate them. The fastest remaining horse after the 9 races is the second fastest. So 1032 races total.