"Algorithmic research" 25 horse races, only 5 horses at a time, the fastest race to find the fastest running 3 horses? The race cannot be timed, and the speed of each horse is assumed to be constant.

Source: Internet
Author: User

The answer is 7 times.

1. First, 25 horses were divided into 5 groups A, B, C, D, E to compete. The number of matches is 5 times. Get the first name of each group, numbered a1,b1,c1,d1,e1 respectively.

2. Then we will play the first place in each group and draw the result. Suppose A1>b1>c1>d1>e1. (The greater than sign indicates that A1 is faster than B1 and 1 is the first place). In this place we can infer that A1 is the fastest of all horses, so it is the first. D1,e1 could not be the first three horses, and the two horses in the same group could not be the first three horses. So the two groups of horses were excluded, and three groups of 15 horses were left. Now we need to find the second and third fastest horses.

3. The second and third horses had the following distribution in the competition:

All in Group A (the fastest horse in the group), then it has A1 and A3.

All in group B, then they are B1 and B2.

A horse in Group A is in Group B, then they are A2 and B1. Either the third place in Group A or the second is the two in Group A.

A horse in Group A in Group C, then they are A2 and C1.

One in Group B and one in Group C, then they are B1 and C1.

So we took the a2,a3,b1,b2,c1 out and played a game. Taking the first two is the final result.

Reference: http://coolshell.cn/articles/1202.html

"Algorithmic research" 25 horse races, only 5 horses at a time, the fastest race to find the fastest running 3 horses? The race cannot be timed, and the speed of each horse is assumed to be constant.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.