Saturday, November 8, 2008

Crossing the bridge.

4 people have to cross the bridge: Child, Father, Uncle, Grandpa.All they have is a single flashlight and for some reason they know thatthe batteries will last for exactly 60 minutes.
It is also quite foggy, the beam of the flashlight cannot be seen for more than a few meters - the bridge is far longer.The bridge can carry only two persons at a time - strange enough, it depends only on the *number*, not on the *weight* of the people.

However, each person takes a different amount of time to cross the bridge:
Child: 5 min
Father: 10 min
Uncle: 20 min
Grandpa: 25 min
In what order do they have to cross the bridge so that nobody is on the bridge in the dark - *and* the flashlight doesn't burn out before they all reached the other side?

Answer:
All people are on BankA and they want to reach BankB.
1)Child and Father cross the bridge from BankA to BankB(10 min)
2)Child returns to BankA(5 min)
3)Uncle and Grandpa cross the bridge from BankA to BankB(25 min)
4)Father returns to BankA (10 min)
5)Child and Father cross the bridge from BankA to BankB(10 min)

Total Time consumed is: 10+5+25+10+10 = 60 min.

Friday, November 7, 2008

The N fast Horses

There are 25 horses, you need to rank them on the basis of their speed. They all run at the same speed everytime. Given that you can run only 5 of them at a time.
(1) What do you think how many races to will it take to rank all of them from 1 to 25
(2) How many races will it take to find out the fastest one?
(3) How many races will it take find the top 5 fastest?

Answer:
We group the 25 horses in 5 groups each containing 5 horses.In each of first five races we will rank each five horsesA, B,C,D and E ( A : fastest and E: slowest) in the group.
1A 1B 1C 1D 1E
2A 2B 2C 2D 2E
3A 3B 3C 3D 3E
4A 4B 4C 4D 4E
5A 5B 5C 5D 5E
In the sixth race ( among the first of each group) we will get the fastest horse and rank these five horses 1A,2A,3A,4A & 5A (1A : fastest and 5A slowest). Similarly just select the fastest of the remaining horses from each row for the race.
Now we have got the fastest horse 1A and will also set nomenclature for each horses.The fastest of the remaining horses in the row will take part.For e.g. the seventh race will be between 1B & 2A (no need to run 3A,4A & 5A)for determining2nd fastest horse.
The 8th race will determine the third place and it will be between 1C and 2B ( in case 1B wins 7th race) or among 1B,2B & 3A ( in case 2A wins 7th race).
The 9th race will determine the 4th place and the 10th race will determine 5th place.And moving on 25 th race will determine 20th place.The 26th race will tel the remaining 5 ranks.