Wednesday, October 29, 2008

Camel and Bananas

A camel is sitting by a stack of 3000 bananas at the edge of a 1000-mile-wide desert. He is going to travel across the desert, carrying as many bananas as he can to the other side. He can carry up to 1000 bananas at any given time, but he eats one banana every mile. What is the maximum number of bananas the camel can get across the desert? How does the camel do it? Be prepared to present your solution to the class.

Hint: The camel doesn't have to go all the way across the desert in one trip.

Answer: Since camel can carry at most 1000 bananas at a time, if it carries all 1000 bananas and travels it will reach the market with zero bananas and cannot came back to fetch the remaining 2000 bananas, so this problem has to be solved by "divide and conquer" technique.

To take 3000 bananas it has to go three times in the direction of market and 2 times towards the stack. That is it has to make 5 trips to carry all bananas from starting point.



P (Stacked Point)

===forth===>
<===back==== ===forth===>
<===back==== ===forth===>


A


===forth===>
<===back==== ===forth===>


B



===forth===>



M (market)

Note that section PA must be in the solution (as explained above), but section AB or section BM might have a length of 0. Let us now look at the costs of each part of the route. One kilometre on section PA costs 5 bananas. One kilometre on section AB costs 3 bananas. One kilometre on section BM costs 1 banana. To save bananas, we should make sure that the length of PA is less than the length of AB and that the length of AB is less than the length of BM. Since PA is greater than 0, we conclude that AB is greater than 0 and that BM is greater than 0.

The camel can carry away at most 2000 bananas from point A. This means the distance between P and A must be chosen such that exactly 2000 bananas arrive in point A. When PA would be chosen smaller, more than 2000 bananas would arrive in A, but the surplus can't be transported further. When PA would be chosen larger, we are losing more bananas to the camel than necessary. Now we can calculate the length of PA: 3000-5*PA=2000, so PA=200 kilometres. Note that this distance is less than 500 kilometres, so the camel can travel back from A to P.

The situation in point B is similar to that in point A. The camel can't transport more than 1000 bananas from point B to the market M. Therefore, the distance between A and B must be chosen such that exactly 1000 bananas arrive in point B. Now we can calculate the length of AB: 2000-3*AB=1000, so AB=333 1/3. Note that this distance is less than 500 kilometres, so the camel can travel back from B to A. It follows that BM=1000-200-333 1/3=466 2/3 kilometres. As a result, the camel arrives at the market with 1000-466 2/3=533 1/3 bananas.

Monday, October 27, 2008

Count 45 minutes with 2 ropes that burn one hour each.

There are 2 ropes that are not of same lenght , but both take an hour each to burn completely.
You are given a lighter and no clock. You have to measure 45 minutes.

Answer: Light one rope from both ends and another rope from one end. The rope that is lit from both ends burns out completely in 30 minutes. The rope that is lit at one end is burnt half. At this point of time, light the other end of the rope too. The left half of the rope will burn in 15 minutes.

Lightest of 8 Balls

You are given 8 balls that look alike. All are of same weight except for one that is lighter by a kilo.You are given a balance and 2 chances to separate out the lightest.

Answer: Divide 8 ball into 3 groups. 2 groups of 3 balls and one group of 2 balls. First take the 2 groups of 3 balls and place one group on the left and other to the right.

Case 1- One side of the pan containing lighter ball goes up:
That means one of the 3 balls is lighter. Clean the balance and take any 2 balls from the lighter group and place them on either side of the pan. If this weighing contains any lighter ball then that side of the pan goes up. If both balance out to be equal, than the lighter ball is the one that is left out.
Case2 -Both balance out to be equal:
This implies that the lighter ball is one among the 2 left behind. Clear the balance and place one ball on each side and weigh them.

The same thing can also be applied for 9 balls where each group will have 3 balls.

Sunday, October 26, 2008

Measure exactly 2 liters of water.

Measure exactly 2 liters of water if you have:
1) 4 and 5-liter bowls
2) 4 and 3-liter bowls

Answer:
1) Solution for 4 and 5-liter bowls :
a) Fill 4 liters bowl and empty it into 5 liters bowl.
b) Fill 4 liters bowl again and empty 1 liter into 5 liters bowl which has 4 liters already.
c) Empty the 5 liter vessel completely. Now empty the 4 liter bowl which has 3 liters into 5 liters bowl. 5 liters bowl now has 3 liters.

d) Fill the 4 liters bowl and empty 2 liters into 5 liters bowl to make it full. 4 liters bowl now has 2 liters in it.

2) Solution for 4 and 3-liter bowls:
a) Fill 4 liters bowl and empty 3 liters into 3 liters bowl.
b) Empty 3 liters bowl and then empty 1 liter from 4 liter bowl to 3 liter bowl.
c) Fill 4 liter bowl and empty 2liters into 3 liter bowl to make it full. 4 liters bowl now has 2 liters in it.

Saturday, October 25, 2008

Finding the contaminated pill jar.

There are 5 jars of pills. Each pill weighs 10 milli gram, except for contaminated pills contained in one jar, where each pill weighs 9 mg. You are given a scale, how could you tell which jar had the contaminated pills in just one measurement?

Answer: Take 1 pill from first jar, 2 from second jar, 3 from the third , 4 from fourth and 5 from fifth jar.
There are 15 pills and in ideal case there total weight should be 15*10 = 150 mg. Now that there is a jar with contaminated pill the weight is obviously less than 150 mg. If weight is 149mg then that means the jar 1 is contaminated. If weight is 148 mg then jar 2 is contaminated. If weight is 147 mg the jar 3 is contaminated. If weight is 146 mg then jar 4 is contaminated. If weight is 145 mg the jar 5 is contaminated.

Minimum folds to make a triangle out of US $1 note

What is the minimum number of folds required to make a triangle out of US $1 note?
My Guess(correct me if I am wrong):
2 folds.
Dimension of US $1 note is 2.6 Inches by 6.1 Inches
We need a square to make a triangle. So the first fold vertically almost makes it a square and the next diagonal fold make it a triangle.

Electric bulbs and switches.

A basement room has 3 electric bulbs installed, labeled A, B and C. Their switch points are in ground floor. Each switch corresponds to one lightbulb (ie, A might turn on 3, B = 2, and C =1).
You have to determine which switch is for lights which bulb. You are allowed to enter the basement only once.

Answer: Electric bulbs heat up on igniting. Turn any switch for 10 mins. Switch it off. Turn on another switch and go to the basement. The bulb that is glowing is for the switch that is on. The bulb that is hot is for the switch that was perviously turned on. The last switch is for the other bulb.

Crystal Glass Balls and Tower

There is a 100 storey tower and you are given some number of crystal glass balls. You want to determine the lowest floor at which a crystal glass ball breaks.What is the most efficient way of doing this?

Hint: You take a crystal glass ball and drop it from 1st floor and if it does'nt break, you drop the same ball from second floor and check now.

Answer:
We need at least 2 crystal glass balls. Take ball no 1 and drop it from floor no 1, if it does not break, got to floor no 10 and drop it. If it does not break drop from floor no 20, do this from 30th, 40th, 50th,60th,70th floors. Suppose in out case the ball breaks from 76th floor, then by dropping it from 80th floor the ball breaks.

Now we know that the ball breaks in the floor that lies between 71 to 80. Take the second ball and drop it from 71th floor and continue for 72th,73rd,74th, 75th and 76th. In our case the ball breaks in 76th floor.
So with 2 balls and least number of tries we determined the floor.

Bags and Colored Balls

Bag A has 10 Red balls and Bag B has 10 Green balls.
Shuffle Bag A move three balls from A to B then shuffle Bag B move three balls from B to A.
Which bag is likely have more number of balls of other color.

Answer: The chances are same.
Think about how many red ball will move back to A.
If just one, then Bag A will have 2 green, Bag B will have 2 red,
If just two, then Bag A will have 1 green, Bag B will have 1 red,
If all three, A doesn't have green, b doesn't have red.

Tuesday, October 21, 2008

Apple and Orange Box Puzzle.

There are 3 boxes in a room. All boxes are labeled incorrectly.Pick one piece of fruit from 1 box to relabel correctly.

Box - Label
~~~~ ~~~~
Box 1 - "Apples"
Box 2 - "Oranges"
Box 3 - "Apples & Oranges"

Answer:
Pick the fruit from the box labelled "Apples & Oranges"..

If the fruit is an orange:
Box labelled "Apples & Oranges" is the "Oranges" box.
Box labelled "Oranges" is the "Apples" box.
Box labelled "Apples" is the "Apples & Oranges" box.

If the fruit is an apple:
Box labelled "Apples & Oranges" is the "Apples" box.
Box labelled "Apples" is the "Oranges" box.
Box labelled "Oranges" is the "Apples & Oranges" box.