Q:David wants to cross a desert.
He have few identical cars.
Each car can go till the middle of the desert, if they are fully fuelled.
Cars can transfer petrol each other.
There is no petrol station in the desert.
How can he cross the desert?
A: There are many answers to this question. You can apply any logic. Two of them which are commonly answered, given below.
Solution 1:
Start with 4 fully fueled cars.
At a quarter of the way, all cars are half full.
Sacrifice two cars and fill up both the other two (Empty cars left behind).
At half way, both the cars that are carrying on, are half full again.
Sacrifice one of them and finish the journey with the last car.
Solution 2:
Start with 4 fully fueled cars.
At 1/6th of the way, all cars are 2/3rd full. sacrifice one car and fill up two of the other cars. Two cars are now full, one is 2/3rd full. (Empty car is left behind.)
At 2/6th of the way, two cars are 2/3rd full. One car is one third full, and sacrifices itself to fill up one of the other cars. One car is now full, one is 2/3rd full. (Empty car is left behind.)
At half way, one car is 2/3rd full. One car is one third full, and sacrifices itself to fill the other car, which is now full and can make the other half of the journey.
He have few identical cars.
Each car can go till the middle of the desert, if they are fully fuelled.
Cars can transfer petrol each other.
There is no petrol station in the desert.
How can he cross the desert?
A: There are many answers to this question. You can apply any logic. Two of them which are commonly answered, given below.
Solution 1:
Start with 4 fully fueled cars.
At a quarter of the way, all cars are half full.
Sacrifice two cars and fill up both the other two (Empty cars left behind).
At half way, both the cars that are carrying on, are half full again.
Sacrifice one of them and finish the journey with the last car.
Solution 2:
Start with 4 fully fueled cars.
At 1/6th of the way, all cars are 2/3rd full. sacrifice one car and fill up two of the other cars. Two cars are now full, one is 2/3rd full. (Empty car is left behind.)
At 2/6th of the way, two cars are 2/3rd full. One car is one third full, and sacrifices itself to fill up one of the other cars. One car is now full, one is 2/3rd full. (Empty car is left behind.)
At half way, one car is 2/3rd full. One car is one third full, and sacrifices itself to fill the other car, which is now full and can make the other half of the journey.
0 comments:
Post a Comment