How many steps are required to break an m x n bar of chocolate into 1 x 1 pieces? We may break an existing piece of chocolate horizontally or vertically. Stacking of two or more pieces is not allowed.
Solution:
Consider a 3x4 bar chocolate.
You will first require 2 horizontal breaks -creating 3 -1x4 bars => Count = 2
You will require 3 vertical breaks on the 1st 1x4 bar => Count = 5
You will require 3 vertical breaks on the 2nd 1x4 bar => Count = 8
You will require 3 vertical breaks on the 3rd 1x4 bar => Count = 11
So for a 3x4 bar chocolate you will require 11 breaks = (3*4) -1
In general you will require mn-1 breaks
Thursday, May 13, 2010
Cards - 1
A blind man is handed a deck of 52 cards and told that exactly 10 of these cards are facing up. How can he divide the cards into two piles, not necessarily of equal size, with each pile having the same number of cards facing up?
Solution:
Blindman makes 2 piles, P1 - 42 cards and P2 -10, He then flips all the cards in P2.
Example : If there are 6 cards facing up in P1 and 4 in P2 after the split. When he flips all the cards in P2 he will have 6 cards facing up and 4 cards facing down - Hence both the piles have the same number of cards facing up.
Solution:
Blindman makes 2 piles, P1 - 42 cards and P2 -10, He then flips all the cards in P2.
Example : If there are 6 cards facing up in P1 and 4 in P2 after the split. When he flips all the cards in P2 he will have 6 cards facing up and 4 cards facing down - Hence both the piles have the same number of cards facing up.
Marbles -1
You have 50 red marbles, 50 blue marbles and 2 jars. One of the jars is chosen at random and then one marble will be chosen from that jar at random. How would you maximize the chance of drawing a red marble? What is the probability of doing so? All 100 marbles should be placed in the jars.
Solution:
Put a single red marble in one jar and the rest of the marbles in the other jar. This way, you are guaranteed at least a 50% chance of getting a red marble (since one marble picked at random, doesn’t leave any room for choice). Now that you have 49 red marbles left in the other jar, you have a nearly even chance of picking a red marble (49 out of 99).
So let’s calculate the total probability.
Solution:
Put a single red marble in one jar and the rest of the marbles in the other jar. This way, you are guaranteed at least a 50% chance of getting a red marble (since one marble picked at random, doesn’t leave any room for choice). Now that you have 49 red marbles left in the other jar, you have a nearly even chance of picking a red marble (49 out of 99).
So let’s calculate the total probability.
P( red marble ) = P( Jar 1 ) * P( red marble in Jar 1 ) + P( Jar 2 ) * P( red marble in Jar 2 )
P( red marble ) = 0.5 * 1 + 0.5 * 49/99
P( red marble ) = 0.7474
Thus, we end up with ~75% chance of picking a red marble.
P( red marble ) = 0.5 * 1 + 0.5 * 49/99
P( red marble ) = 0.7474
Saturday, May 8, 2010
Monkey and Coconuts
Ten people land on a deserted island. There they find lots of coconuts and a monkey. During their first day they gather coconuts and put them all in a community pile. After working all day they decide to sleep and divide them into ten equal piles the next morning.
That night one castaway wakes up hungry and decides to take his share early. After dividing up the coconuts he finds he is one coconut short of ten equal piles. He also notices the monkey holding one more coconut. So he tries to take the monkey's coconut to have a total evenly divisible by 10. However when he tries to take it the monkey conks him on the head with it and kills him.
Later another castaway wakes up hungry and decides to take his share early. On the way to the coconuts he finds the body of the first castaway, which pleases him because he will now be entitled to 1/9 of the total pile. After dividing them up into nine piles he is again one coconut short and tries to take the monkey's slightly bloodied coconut. The monkey conks the second man on the head and kills him.
One by one each of the remaining castaways goes through the same process, until the 10th person to wake up gets the entire pile for himself. What is the smallest number of possible coconuts in the pile, not counting the monkeys?
Solution:
2519 The solution for the answer is the LCM (Lowest Common Multiple) of 10,9,8,7,6,5,4,3,2,1 -1. LCM would give the least number which is divisible by all of these number and subtracting one would give us the number of coconuts which were initially there.Socks
Cathy has six pairs of black socks and six pairs of white socks in her drawer.
In complete darkness, and without looking, how many socks must she take from the drawer in order to be sure to get a pair that match?
Solution:
3
Socks do not come in in left and right, so any black will pair with any other black and any white will pair with any other white. If you have three socks and they are either colored black or white, then you will have at least two socks of the same color, giving you one matching pair.
3 and 5 Gallons
You have a three gallon and a five gallon measuring device. You wish to measure out four gallons of water, Assume there is infinite supply of water.
Solution:
Fill the five gallon container. Pour all but two gallons into the three gallon container. Empty the three gallon container. Put the two remaining gallons from the five gallon container into the three gallon container. Fill the five gallon container one more time. Pour one gallon from the five gallon container by filling the three gallon container. Now the five gallon container contains four gallons.
Solution:
Fill the five gallon container. Pour all but two gallons into the three gallon container. Empty the three gallon container. Put the two remaining gallons from the five gallon container into the three gallon container. Fill the five gallon container one more time. Pour one gallon from the five gallon container by filling the three gallon container. Now the five gallon container contains four gallons.
Ants
Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picks a direction and starts to move along the edge of the triangle. What is the probability that none of the ants collide?
Solution:
lets assume all three ants are looking towards the center. They will not collide if all of them are moving towards left or towards right. Even if one of the ants starts to move to the other direction there will be a collision. There are the following eight optio
RRR
LLL
RLL
RLR
RRL
LRL
LRR
LLR
The ants will not collide in case of LLL and RRR so the probability of not colliding is:
2/8 = 0.25
The probability of ants colliding is 6/8=0.75
Solution:
lets assume all three ants are looking towards the center. They will not collide if all of them are moving towards left or towards right. Even if one of the ants starts to move to the other direction there will be a collision. There are the following eight optio
RRR
LLL
RLL
RLR
RRL
LRL
LRR
LLR
The ants will not collide in case of LLL and RRR so the probability of not colliding is:
2/8 = 0.25
The probability of ants colliding is 6/8=0.75
Subscribe to:
Posts (Atom)
