Wednesday, August 29, 2012

Bridge Puzzle

Q : Arrive with a solution where all the 4 people will cross the bridge with less than 17 as a total value.

Four People have to cross a bridge from A to B. Example W,X,Y and Z. W has a value 8, X has a value 5, Y has a value 2 and Z has a value 1.

Limitations :
  • Maximum Two people can travel at a time. The Maximum Value of the two is considered.
  • Only one Lantern is there which has to be carried to cross the bridge.

Solution : 

Solution with value count = 17.

Step 1 : Y and Z travel together with the Lantern. Max value of Y and Z, Y = 2. Count = 2
Step 2 : Z comes back with the Lantern.Return value of Z = 1.Count = 3
Step 3 : X and Z travel together with the Lantern. Max value of X and Z, X = 5.Count = 8
Step 4 : Z comes back with the Lantern.Return value of Z = 1.Count = 9
Step 5 : W and Z travel together with the Lantern. Max value of W and Z, W = 8. Count = 17

Solution with value count = 15.

Step 1 : Y and Z travel together with the Lantern. Max value of Y and Z, Y = 2. Count = 2
Step 2 : Z comes back with the Lantern.Return value of Z = 1.Count = 3
Step 3 : W and X travel together with the Lantern. Max value of W and X, W = 8.Count = 11
Step 4 : Y comes back with the Lantern.Return value of Y = 2.Count = 13
Step 5 : Y and Z travel together with the Lantern. Max value of Y and Z, Y = 2. Count = 15

Water Bucket Puzzle

Q : Arrive with a Solution having Exactly 4 liters of water in a bucket.

There are two buckets one can hold 5 liters of water, the other can hold 3 liters of water. No restriction on Water.



Solution :

Step 1 : Fill the 5 liter Bucket.
Step 2 : Fill the 3 liter Bucket using the water in 5 liter Bucket.
Step 3 : 5 liter Bucket will now have 2 liters in it. Empty out 3 liter Bucket.
Step 4 : Empty the 2 liters present in 5 liter bucket to the 3 liter Bucket.
Step 5 : Fill the 5 liter Bucket Again.
Step 6 : Fill the 3 liter Bucket completely using the water in 5 liter Bucket.

Solution Step 7 : 5 liter Bucket will now have Exactly 4 liters of water.