Athenahealth
Company
Numerical Ability
There are 25 Horses which all run at different speeds. A faster horse always beats a slower horse. You can race 5 horses at a time. There are no ties and you may not time them. What is the minimum number of races needed to determine the 3 fastest horses in order from fastest to slowest.
Read Solution (Total 11)
-
- Answer is :7 races
to refer follow the below link...
http://www.programmerinterview.com/index.php/puzzles/25-horses-3-fastest-5-races-puzzle/ - 10 years agoHelpfull: Yes(17) No(0)
- minimum 6 races are required.
b'coz five group select 5 fastest horses among 25 as told Rajesh Bharti. then according to question "A faster horse always beats a slower horse. so in sixth race top three horses will be fastest. - 10 years agoHelpfull: Yes(16) No(5)
- minimum 11 turns..
b'coz in first 5 ,if 3 is selected then there is a chance that these 3 can be the fastest of 25th..so we have consider each race.. - 10 years agoHelpfull: Yes(5) No(0)
- Minimum 8 races are required...
Suppose A1,A2.....A25 are horse.
Make Five groups of Horses i.e A1-A5, A6-A10 and so on. Then we will get 5 fastest horses among these groups, suppose(A1,A6,A11,A16,A21). In sixth race,we will get the fastest horse among these five fastest horses,suppose A1. In seveth race between rest fouri ie.(A6,A11,A16,A21) we will get the second fastest one, suppose A6. In 8th race we will get the fastest among rest three i.e(A11,A16,A21). so, finally in 8th race we will get the three fastest horses. - 10 years agoHelpfull: Yes(3) No(4)
- Minimum 7 races required.
A1 B1 C1 D1 E1
A2 B2 C2 D2 E2
A3 B3 C3 D3 E3
A4 B4 C4 D4 E4
A5 B5 C5 D5 E5
Consider the above five races first to find top (A1,B1,C1,D1,E1). Lets race top 5 (5+1 now). We say winners are (A1 B1 C1).
Here A1 is absolute top to all. There is a possiblity where B1 might be slower than A2,A3,A4,A5.
So Race B1, A2, A3, A4, A5 (Now 5+1+1 = 7). If A3 beats B1, top hourses are A1,A2,A3.
Please let me know if the explanation suits.
- 10 years agoHelpfull: Yes(3) No(0)
- 7 races totaly to find fastest 3 horse
- 10 years agoHelpfull: Yes(2) No(4)
- Minimum 7 races are reqd.
divide the horses in 5 groups as follows:
A1,A2,...,A5
B1,B2,....B5
C1,C2,....C5
D1,D2,....D5
E1,E2,....E5
Now we race all five groups. let's assume that A1,A2,B1,B2,....,E1,E2 come first and seconds in their respective races. Now we are left with only 10 horses.
Now race A1.B1,...E1. Lets say A1,B1 and C1 come first,second and third in this race.
After this, the possible candidates are A1,B1,C1,A2 and B2. Race them and find the top 3. - 10 years agoHelpfull: Yes(1) No(4)
- I agree with Mr.Upendra singh, we can determine in the 6th race itself.. The 6th race is for toppers who won in previous 5 races and we can determine top 3 in that race. so it can be final race.
- 10 years agoHelpfull: Yes(1) No(1)
- minimum number of races required are 6
6 races are enough as in 5 races 5 best horses are chosen. now give a race for these best 5 horses of these can select best three horses.
so 6 are sufficient. - 10 years agoHelpfull: Yes(1) No(0)
- answer:3 races
- 10 years agoHelpfull: Yes(0) No(3)
- Ans : 7 races
Group all the horses into group of 5 and race them.
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
Let the 1,2,3 denote the winners from each group.
Now 5 races are over.
All the 4th and 5th placed horses can be eliminated.
So it leaves 3*5=15 horses
6th race :
a1 b1 c1 d1 e1
Let the finish be in order a1 b1 and c1.
Now a1 is the fatest of all the horses for sure.
So keep it reserved.
Now we can eliminate all horses under d and e group.
And eliminate horses c3,c2 and b3.
That leaves us with a1,a2,a3,b1,b2,c1
a1 is the best so keep it aside and race the remaning 5 horses.
7th race is :
a2,a3,b1,b2,c1
The top 2 from the race would be 2nd and 3rd respectively! .
So the answer is 7 - 9 years agoHelpfull: Yes(0) No(0)
Athenahealth Other Question