• Vehicles • Fashion • Recipes • Blogs • Hunt • Travels • Sport • Fun • Handmade • IT • Education
Mini-Games
x

x
zakruti.com » Knowledge, science, education » Logically Yours
Difficult Puzzle 25 Horses Race Asked in Google and Microsoft Interviews

Difficult Puzzle 25 Horses Race Asked in Google and Microsoft Interviews

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Difficult Puzzle -- 25 Horses Race -- Asked in Google and Microsoft Interviews SHAGUN: To understand this tricky part properly consider a simple question- u got three horses A, B, C and u need to mark the fastest horse( which scores 1st rank) condition is you can race upto 2 horses at a time.
1st race would between A, B/ B, C/ A, C (these three probabilities exist here)
(1) suppose 1st race is between A n B and A wins(scores 1st rank, this means B has scored 2nd rank. so 2nd race must be conducted between A n C not between BnC to get the fastest from these three. why! Let me xplain;
Suppose
(i) 2nd race is between B and C and B scores 1st rank in this race. So u can draw following conclusion that A is faster than B n B is Faster than C so A is the winner. but
(ii) if C wins in 2nd race then you have to conduct a 3rd race between AnC and here you will find the fastest one in 3rd race. But you don't need this 3rd race. u can pick the 1st ranker in 2nd race, let me xplain how!
Suppose
u directly conduct 2nd race between AnC and
(i)if A wins then A is ultimately 1st ranker, since A is winner in 1st race n A is winner in second race so A is faster than B and C
(ii) if C wins then C is ultimately 1st from remaining two bcoz C is faster than A n A is faster than B(already proved in 1at race) so C is aslo faster than B. Simple maths logic
(C>A n A>B - C>A. 8>5 n 5>3- 8>3. simpl no)
So you need only 2 races to decided who is fastet. Typing and den explaining is hard, doing it practically makes it easy to understand.
Simple no. try it with your friends in front of u to understand better.
If you understand this probability and relation concept you will easily get my question into your solved question & answers list.
That question in the video is similar to this but quite hard bcoz u got many horses and u get stuck between probability and relation issue, even I got stucked until I tried this with 3 horses.

Date: 2023-11-15

Comments and reviews: 29


How the hell would we know which of the horses are fastest? We would need some way of measuring top speed of each horse during the race. For example, one of the horses of 5 that raced that crossed the finish line in position 4 or 5 (2nd to last place or last place, could have actually been the fastest (for a brief time, such as it maxed out at 42 MPH briefly (faster than any other horse in its race group, but came in last place in that race group because of lowest average speed in that race group. Another flawed puzzle (almost none of them are without flaws. However, assuming we had a device that could record top speed of all 5 horses simultaneously, then 5 races should be sufficient to find the 3 fastest horses of the 25. For example, horse # 4 in race group # 3 maxxed out at 43 MPH briefly, so it is the #1 fastest horse (of the 25, then we just pick the next 2 highest. Fastest has nothing to do with who wins the race, only which 3 hit the highest top speeds. It is a badly worded question that doesn't match the answer given here by Logically Yours. Fast is normally associated with speed. Quick is normally associated with time. Here, when a horse crosses the finish line first, we would say it is the quickest of the race group, not the fastest of the race group (although it will have the fastest average speed. It seems to me that whoever made up this puzzle, did NOT have a clear understanding of the difference between the words fastest and quickest. It seems they really want us to pick the 3 QUICKEST horses (the 3 that would cross the finish line 1st, 2nd, and 3rd, if we were able to race all 25 of them at the same time. Another flaw of this puzzle is it assumes the horses will run cross the finish line in the same amount of time each race which of course is not true in real life, however, that should have been stated in the puzzle.
reply

this is kinda nice since it explains even how microsoft creates some of their problems by thinking like this. and by that i am saying there are more races needed to determine the fastest horse. for example what you dont concider is that one horse might be doped or in a bad mood dont wanting to give 100% similarly a rider might be bribed to slow down or one horse despite beeing faster might have had an accident during one or more races. the one determining which horse came in first might have done a mistake or was influenced by outside source to decide wrong. even the wind blowing against the horse riding direction and blowing in the riding direction in a nother race. i could go on and on and on. but it shows like microsoft just -assumes- none of those exception are given there for it works. thats not how it should be. you cannot assume divion by zero never occours just because you slap an on error goto next on every situation outside sources like vibration of transistores caused by internal speaker to switch bits. hacks like that are possible thanks to microsofts way of thinking -not outside the box-. the riddle as most is based upon a perfet world. and this isnt consistent with reallife there for. my logical answer would be somewhat different. i would even go as far as to state that 0 races are required to determine a answer PLUS with a unlimited amount of races no answer is 100% right you can come closer to the truth but thats it. both statements are right at the same time its kinda like f(x) = 1/x. .there kinda is a point at 0, 0 but then again there is not
reply

I just watched this SAME EXACT problem in a different video, but your visual explanation of eliminating horses is FAR SUPERIOR! And seven races is the optimal solution that will work for every scenario possible.
HOWEVER. There are two scenarios where six races could work. They are not statistically significant but they do work.
Race the first five horses, pass the winner on to the second race with four new horses. Pass that winner on to the third race, adding four new horses. Pass that winner on to the fourth race, adding four new horses. Pass that winner on to the fifth race, adding four more horses. For the sixth race, take that winner, and add the four remaining horses.
Scenario A: The horse passed on from the fifth race only places 4th or 5th. This means that the 3 fastest horses out of 25 were in the last four remaining horses.
Scenario B: The horse passed on from the fifth race placed 3rd. This means that the 2 fastest horses out of 25 were in the last four.
In either scenario, the 3 fastest horses were identified in only six races.
IF the horse passed on from the fifth race places 1st or 2nd in the sixth race, then you are stuck with having at least two runoff races to test horses eliminated from earlier races.

reply

Sort the horses into 5 races of 5 horses each.
Then, the winner of each race will race each other in a -championship- race. The winner of that race is the fastest horse.
Now, you could repeat this strategy 2 more times to find the second and third fastest horses for a total of 18 races. But we can do much better than that.
We can use the information from the races we've already run to remove any horse that can't be 2nd or 3rd fastest. The 4th and 5th finishers in the championship race qualify, and since they won their races, any of the horses form their races must be slower than them and thus not 2nd or 3rd fastest.
When you rule out any horse that cannot be 2nd or 3rd, you are left with horses that either only lost to the champ, or the champ and one other horse (meaning they could be 2nd or 3rd):
2nd and 3rd from the champ's first race
2nd and 3rd from the championship race
2nd from the runner up's first race.
That's 5 horses, so run one last race with these 5. The winner of this race is the 2nd fastest horse, the runner up is the third-fastest horse. So only 7 races in total.

reply

And how do you prove that your initial approach with racing separate groups of 5 is optimal? Maybe there's a different approach that mixes in old horses to get a result in only 6 races?
example:
you race 5 horses, suppose the 3 fastest horses are among them.
then if you take the 3rd fastest horse and race it with 4 other horses, that 3rd horse will be 1st in the 2nd race and every other race. that would mean that you have used only 6 races overall if you're 'lucky' in your initial pick of horses.
So can you prove that 7 is the actual minimum and there isn't a better 'mixing' strategy that sometimes gives 6 races, and sometimes 7, but on average requries less than 7 races?

reply

Thats not optimal solution. Total number races needed is 6. If there are 24 horses, total number of races needed will be 5. Race 5 horses and compare 3rd one to new group of 4. Every time horse come before your 3rd horse from starting group, take second horse and mark one that come first. Repeat process until you tested all. Now compare winers and one that are left with remaining 2 races and you het 6 races. So for 5 horses you need one race, for 6-9 you need 2, for 10-14 you need 3, for 15-19 you need 4, 20-24 you need 5 and for 25-29 you need 6.
reply

I was asked this question in an interview. I answered like this, you make 5 horses run from one end of track and another 5 from other end of track. So in one race we can compare 10 horses. You Stand in middle of track so first 5 horses who reach at middle of track are the ones who win. We will get 5 from 1st race, 5 from 2nd race and in 2 races we would have covered 20 horses. We now we can again compare these 10 horses so we will get top most 5 from initial 20. Now last 4th race.
And you get top 3

reply

Imagine after the race you realise one of your friend has a stop watch and he showed you the times of each horse.
Suppose the horse A1 finished with a time of 10 seconds
and the times of group E horses are
E1- 9. 10s E2- 9. 20s etc E5- 9. 50s
Even the worst horse in the group E finished faster than horse A1 yet you eliminated that horse on the first elimination.
now tell me how can you find the three fastest horse while this scenario is absolutely possible.

reply

7.
5 groups of 5 to start.
1 race of the fastest in each heat. Eliminate: all the horses in the slowest two heats. 4 slowest horses in the third slowest heat. 3 slowest horses in the second slowest heat. 2 slowest horses in the fastest heat.
Besides the fastest horse, that leaves 5 horses you need to test. Run one last race for them and you're good

reply

I guess we can find fastest 3 horses in 6 races. If im not wrong.
We can put horses into 5 groups with 5 horses in each group. Then we'll conduct races for each group. In each race we shall select no. 1 fastest horse. Then we will be remained with top 5 fastest running horses. If race is conducted among them. We can find fastest 3 horses.

reply

Idk I got 6.
25/5 is 5 races. Which means we have 5 horses left and 5 lanes.
Every race has a winner, which will later run against the other winning horses.
So we can have the 5 winners of each group have one more race.
The first 3 are the winners, given we can clearly see the order they entered the finish line.

reply

- -LOGICALLY YOURS - Want to ask you, What if A4 and A5 where faster than B1, B2 and C1? as you mentioned we need to find -FASTEST- horse from all horses. This wouldn't had confusing if you had not considered elimination. Like eliminating c2 and c3. If you are eliminating then why isn't A4 and A5 case being considered?
reply

6 Races here's how
Race 5 races of 5 and record the winners and map how many furlongs behind the 2nd and 3rd place horse was
Run the 5 winners and map the 2nd and 3rd place horse positions behind in furlongs
Then is just a mater of seeing if any horse would be ahead of the horses in the 6 th race

reply

-WE WILL CONDUCT RACES OF 5 groups oF total 25 HORSES THEN TAKE 5 TOPPERS THEN CONDUCT A RACE OF THOSE 5 HORSES WHO WON THE FIRST ROUND OF 25 HORSES THEN JUST TAKE THE TOP 3 AS FIRST, SECOND, THIRD IN THIS WAY U NEED TO CONDUCT ONLY (5+1=6) 6 RACES NOT 7- ----
reply

the solution is either wrong or the description is insufficient.
A you can race 5 horses at once at maximum, and you do NOT have a watch, it is impossible for you to tell, which one was the fastest race. Hence, the given solution is wrong.

reply

There is a way that takes only 6, but relies on incredible luck. Take the 3rd horse from the 1st race, and race it against the other 20 horses. If it wins every race, then you know that the top 3 of the first race are the top 3 overall.
reply

I don-t always love these videos (as I-ve moaned about in other comment pages, because it-s often about some kinda gotcha mechanic, but I really like this one. A very logical answer, well explained, and well visualised. Thumbs up!
reply

The vid would be much more clear if you didn't label the groups as A thru E before you raced the five winners against each other. Call the groups something else at first, and only rename them A thru E after race 6.
reply

On what grounds did you eliminate rank 4 and 5, what if A5 was faster than B1. They never raced each other. What i mean is what if an entire group was faster than the first one of the other group.
reply

I'm particularly not convinced when you eliminate B3. especially the last race includes C1. how do we know among C1 and B3 who is faster. It can also be B1 < B2 < B3 < C1 (C1 can be slower than B3)
reply

Excellent explanation.
But will it correct if we just conduct 6 races. 6th race of the horses of 1st rank in previous 5 races. The top three horses were the horses of 1st, 2nd and 3rd rank.

reply

finally someone explains the elimination process clearly. Still, this is an awful lot of assumption the horses on the first heat are not all faster than any horses in the other heat.
reply

wait wait if we conduct 5 races and pick the first place holders in all races then we have 5 top horses then if we conduct the 6th race then we can have the 3 fastest horses among them
reply

I did not understand why are we complicating the process after 5 races. We might as well conduct the 6th race between all winner horses and select the first 3 as winners.
reply

6 is the minimum assuming the rules include that you can't slaughter 22 horses before the 1st race. Then it would be less. (This is a hypothetical scenario after all)
reply

Do one thing execute 5 races takes 5 top horses and have one more race you will get top 3 and then take them wid u ---
Take it as a joke not as a logic

reply

I think it is enough to make 6 races. All the first-ranked horses in every group must have a sixth race and we just choose the first three fastest horses.
reply

why he removed the last two rows, there might be a possiblity that the horse come last in a group might be fast than other groups 1st position horse
reply

-I almost passed the test but I failed to reject last two horses and hence my answer came 8 which was wrong obviously. -
reply
Add a review, comment






Other channel videos