Horse racing Problems

Source: Internet
Author: User

Problem C time r program computer relationship method D

Problem:

There are a total of 25 horses and a game venue with 5 tracks. That is to say, a maximum of five horses can be played together.

Assuming that each horse runs very stably and does not use any other tools, only through the competition between the horse and the horse, you can know the minimum number of matches to know the fastest five horses.


Analysis:

First, let's take a look at the general situation. Each time I used a match of five horses, I compared them to five. The results are as follows:

A1 A2 A3 A4 A5

B1 B2 B3 B4 B5

C1 C2 C3 C4 C5

D1 D2 D3 D4 D5

E1 E2 E3 E4 E5

Five horses are in the competition each time, and the speed on the left is greater than that on the right, for example, A1> A2> A3> A4> A5. The four lines below are the same.


In the second round, the game is the fastest in each line, that is, the first row of the game: A1, B1, C1, D1, E1. Assume that the result is A1> B1> C1> d1> E1, a1 is the fastest running 1st.

This assumption indicates that the result is of general significance, because the first line of the first line, when 1st, does not affect the result analysis. Here, the symbols are optional.


Here, we can eliminate half a horse. Because we only take the first five horses, E2 certainly cannot enter the first five because there are at least five horses E1, D1, C1, b1, A1.

If E2 cannot enter the first 5, the right side of E2 cannot do the same, because they are not as fast as E2. Similarly, on the right of D3 and D3, on the right of C4 and C4, B5 cannot enter the first 5.

Therefore, after 6th games, the remaining horses are:

A1 A2 A3 A4 A5

B1 B2 B3 B4

C1 C2 C3

D1 D2

E1


After that, we can select 2nd from the ratio of A2 to B1, C1, D1, and E1, and then select 2nd from the ratio of the remaining two to the ratio of 3rd.

In this way, one place is selected for each game, that is, after 6th matches, and then four matches are compared. The remaining four places are selected. This method is feasible. But it is not what we want.

Because there are too many sessions, you must select the results with the least number of sessions.


Let's consider the same. After the comparison of 6th games, 1st columns and each time are ordered. We didn't use such a local order. Can we decide more than one place in a game?


Yes.

Let's take a look at the results of the above 6th games. We know that 1st A1 members have been decided and don't worry about it. Check that 2nd and 2nd may only be generated from A2 and B1. Why?

Because B1> B2, B1> C1, A2> A3. The lower the speed of each row to the right, the lower the speed of the first column. Therefore, 2nd names can only be generated from A2 and B1.

So there are 3rd. Similarly, 3rd will be generated from A2 A3 B1 B2 C1 (which is left after 2nd sentences are generated) for the same reason as the above 2nd.


So we can make A2 A3 B1 B2 C1 ratio in 7th games, so that we can determine 2nd three.

From the above analysis, we know that the first two of the results of the 7th games must be two or three of the final results.


Here we will summarize a few rules. The last of the 7th matches must not be the top five. Why?

Because it has at least five rankings. For example, if C1 is the last player, there are at least four and 7th contestants in the first place.

Therefore, the first five members in the last game in the first game were excluded.

If C1 is the last one, the lines on the right side of C1 and c1 are also excluded. Because C1 is the fastest in the last three rows.

The last name in the 7th field can only be generated from C1 B2 A3. The reason is as follows: in the above analysis, 3 members can only be generated from A2 B1.


View the possible results of the 7th games:

A2 A3 B1 B2 C1:

Four or five players may be generated from A4 A5 B1 B2, and the results can be determined only in 8th matches.


B1 B2 A2 A3 C1:

Four or five players may be generated from B3 B4 A2 A3, and the results can be determined only in 8th matches.


Through the above results, we can further see that A2 A3 and B1 B2 have a symmetric relationship in a program, that is, they always appear in the results, for example:

A2 B1 A3 B2 and A2 B1 B2 A3

A2 B1 A3 B2 and B1 A2 A3 B2

That is, B1 can appear where A2 appears, and b2 can appear where a3 appears.

In this way, we merge the Solution Branches of the problem.

In this case, we further know that C1 can also appear in A3 or B2.


Now let's take a look at the situation where c1 is the total number of 6th (Total number: indicates that the ranking of 6th in the 1st field is added). At this time, A3 can be the total number of 3rd, 4, and 5.

When A3 is the total number of 3rd players, we need A4 A5 and B1 B2 to form a 8th game to decide the total number of 5 players. The number of horses participating in the competition is not necessarily five, because in this case, the results can be obtained from four horses.

When A3 is the total number of 4th players, the total number of 5 players can be determined in 8th matches between A4 and B2 B3.

Because B2 and A3 are symmetric, the above situation applies to B2 as well. (If A3 is 3rd in total, B2 is 5th in total. The reason why A3 is 5th in total is not found above .)


What if C1 is not 6th?


If C1 is 5th

When A3 is the total number of 3rd, the total number of 5 members can be determined in 8th of A4 A5 B1 C1.

When A3 is the total number of 4th, You need to determine the total number of 8th players in the 5th game of A4 C1.

Because B2 and A3 are symmetric, the above situation applies to B2 as well.


If C1 is 4th

When A3 is the total number of 5th, the total number of 8th members can be determined in 5th of A3 C2 D1.

Because B2 and A3 are symmetric, the above situation applies to B2 as well.


If C1 is 3rd

When A3 is the total number of 5th, the total number of 5 members can be determined in 8th of A2 A3 C2 C3 D1 D2 E1. Because the number of horses participating in the competition is greater than 5, 9th games are required.

Because B2 and A3 are symmetric, the above situation applies to B2 as well.


(There are many symbols. Although careful, I cannot guarantee that there is no problem. After understanding the derivation process, you can deduce it by yourself .)

In summary, the first five can be selected in at least 9 games, and the first five will be available in 8th cases when the situation is good.

------------------------------------------------------------

Is it possible to reduce the number of sessions?

After thinking about this problem for a while, I drew a 5*5 Table to the Excel table and filled the table color. After reasoning for a while, I thought there should be a better situation.


Because we need to take the top 5, the above solution is actually to precisely solve the results, that is, the final result clearly knows the specific ranking of the top 5.

Through thinking about the table, we found that there is actually a distance independence similar to the topology in this table. That is to say, as long as you are in the first five, whether you are 3rd or 4,

Only the first five are allowed.


We started to analyze the data after 6th events.

This is the result of 6th events:

A1 A2 A3 A4 A5

B1 B2 B3 B4

C1 C2 C3

D1 D2

E1

Comparing the results above the split line, we found that the first place of A3 B2 C1 must be in the top 4. Why?

Because A2 A3 B1 B2 C1 has a total of five locations, which can be 2nd, 3, 4, 5, and 6, respectively, the first of the three can also be 4th at the worst.

The last one of them is also the top five, because the solution above the split line has already been mentioned.


Try to analyze:

The possible ranking of A3 B2 C1 is as follows:


A3 B2 C1

In this case, the first five can determine A1 A2 A3.

The remaining two can be selected from B1 B2 A4 A5. Why?

Suppose A3 is the total number of 3rd, then A4 A5 plus the following B1 B2 must have a total of 4th 5 in it, which is also a situation on the split line.

Suppose A3 is the total number of 4th, then A4 and b2 can be used to determine the number of 5th.

Therefore, the remaining two in the first five can be selected from B1 B2 A4 A5.


A3 C1 B2

In this case, the first five can determine A1 A2 A3.

The remaining two can be selected from B1 C1 A4 A5.


B2 A3 C1

In this case, the first five can determine A1 B1 B2

The remaining two can be selected from B3 B4 A2 A3.


B2 C1 A3

In this case, the first five can determine A1 B1 B2

The remaining two can be selected from B3 B4 C1 C2 D1 A2.


C1 A3 B2

In this case, the first five can determine A1 B1 C1

The remaining two can be selected from C2 C3 D1 D2 E1 A2 A3


C1 B2 A3

In this case, the first five can determine A1 B1 C1

The remaining two can be selected from C2 C3 D1 D2 E1 B2 B3.


There are too many horses in the next three cases. We can see that the order of C2 C3 is determined, and the order of D1 D2 is determined. If you know the speed order of C2 D2, you can reduce the number of participating horses.

We selected three for the first 7th matches, and the other two are not wasted.

If c2> d1, then the above C2 C3 D1 D2 E1 can be reduced to C2 C3 d1

If D1> C2, the above C2 C3 D1 D2 E1 can be reduced to D1 D2 E1 C2

In the last two types above, A3 and b2 can determine the size relationship with D2 D1 in 7th games. Therefore, the number of horses participating in 8th games must be within 5.

In the last 3rd cases above, D2 D1 occurs at the same time. After determining their size relationship, you can take the larger one.


Therefore, the first five can be selected in at least 8 games.

------------------------------------------------------------

This is the end.

For such "distributed" reasoning and computing, the human brain does have great limitations. Without the use of paper or pen or computer to record the intermediate process, the derivation is easy to get lost in details.

Take a pen and write it on the paper for a while. The brain is more suitable for linear reasoning. Sure enough, I verified what I said in a previous book.

Horse racing Problems

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.