Navigation Links

Responsive Topnav Example

Resize the browser window to see how it works.

Showing posts with label Puzzles. Show all posts
Showing posts with label Puzzles. Show all posts

Tuesday, April 19, 2016

8 Balls Puzzle


Problem:-

You have 8 balls. One of them is defective and weighs less than others. You have a balance to measure balls against each other. In 2 weighing, how do you find the defective one?

Solution:

Defective ball is light

Make three Groups G1 – 3 balls G2 – 3 balls G3 – 2 balls

First weight- G1 and G2 if G1 = G2 then defective ball in G3 ,
weigh the the 2 balls in G3 if EQUAL then 3rd ball of G3 is defective
else whichever lighter in 1st or 2nd is defective ball

else if G1 < G2 defective ball in G1
weigh 1 and 2 ball of G1 if EQUAL then 3rd ball of G1 is defective
else whichever lighter in 1st or 2nd is defective ball

else if G1 > G2 defective in G2
Again in 1 comparison we can find the odd ball.

So by following above steps in 2 steps, lighter ball can be find out.

The Fox and The Duck Puzzle

Problem:-

A number of different versions of the puzzle are available. For this post we are using the Fox and the Duck version. A duck, pursued by a fox, escapes to the center of a perfectly circular pond. The fox cannot swim, and the duck cannot take flight from the water. The fox is four times faster than the duck. Assuming the fox and duck pursue optimum strategies, is it possible for the duck to reach the edge of the pond and fly away without being eaten? If so, how?

Solution:
This is not a simple mathematical puzzle to solve like normal common problems. Fox in this puzzle is too fast and clever for any normal and simple strategy.

From the speed of the fox it is obvious that duck cannot simply swim to the opposite side of the fox to escape. Pi*R/4 < R.

Let V be the speed of Duck and 4V speed of fox.

Now we need to find out the position from where duck can swim to the shore in time less then Pi*R/4V. Pi = 3.14.

To keep things simple we will take the distance from center for the duck to escape when the fox is on the exact opposite side of the pond to be R/4.
So duck can swim in 3R/4V which is less than Pi*R/4V.

Now the next challenge is how we can make sure the clever fox will be on the opposite side. Here is the tricky part.

Let the duck rotate around the pond in a circle of radius R/4. Now fox and duck will take exact same time to make a full circle. Now reduce the radius the duck is circling by a very small amount (Delta). Now the Fox will lag behind, he cannot stay at a position as well. Now in due time duck will get to a position we wanted, 3/4*R distance away from shore where fox is on the exact opposite side of the pond. From there duck can swim safely to shore and fly away.


Monday, April 18, 2016

Red and Blue Marbles

Problem:
You have two jars, 50 red marbles and 50 blue marbles. You need to place all the marbles into the jars such that when you blindly pick one marble out of one jar, you maximize the chances that it will be red. When picking, you’ll first randomly pick a jar, and then randomly pick a marble out of that jar. You can arrange the marbles however you like, but each marble must be in a jar.

Answer:
Say we put all the red marbles into JAR A and all the blue ones into JAR B. then our chances for picking a red one are:

1/2 chance we pick JAR A * 50/50 chance we pick a red marble
1/2 chance we pick JAR B * 0/50 chance we pick a red marble

You would try different combinations, such as 25 of each colored marble in a jar or putting all red marbles in one jar and all the blue in the other. You would still end up with a chance of 50%.

What if you 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 the maximum probability will be :
jar A : (1/2)*1 = 1/2 (selecting the jar A = 1/2, red marble from jar A = 1/1)
jar B : (1/2)*(49/99) = 0 (selecting the jar B = 1/2, red marble from jar B = 49/99)
Total probability = 74/99 (~3/4)

Blind Bartender’s Problem: The Four Glass Puzzle

Puzzle

The four glasses puzzle, also known as the blind bartender’s problem, is a logic puzzle first publicized by Martin Gardner in his “Mathematical Games” column in the February 1979 edition of Scientific American.

Four glasses are placed on the corners of a square table. Some of the glasses are upright (facing upwards) and some upside-down (facing downwards). You have to arrange the glasses so that they are all facing up or all facing down (while keeping your eyes closed all the time). The glasses may be re-arranged in turns subject to the following rules.

  1. Any two glasses may be inspected in one turn and after feeling their orientation you may reverse the orientation of either, neither or both glasses.
  2. After each turn table is rotated through a random angle.
  3. At any point of time if all four glasses are of the same orientation a ring will bell

You have to come up with a solution to ensure that all glasses have the same orientation (either up or down) in a finite number of turns. The algorithm must be non-stochastic i.e. it must not depend on luck.

Solution:-

  1. On the first turn choose a diagonally opposite pair of glasses and turn both glasses up.
  2. On the second turn choose two adjacent glasses. At least one will be up as a result of the previous step. If the other is down, turn it up as well. If the bell does not ring then there are now three glasses up and one down (3U and 1D).
  3. On the third turn choose a diagonally opposite pair of glasses. If one is down, turn it up and the bell will ring. If both are up, turn one down. There are now two glasses down, and they must be adjacent.
  4. On the fourth turn choose two adjacent glasses and reverse both. If both were in the same orientation then the bell will ring. Otherwise there are now two glasses down and they must be diagonally opposite.
  5. On the fifth turn choose a diagonally opposite pair of glasses and reverse both. The bell will ring for sure.

The puzzle can be generalized to n glasses instead of four. For two glasses it is trivially solved in one turn by inverting either glass. For three glasses there is a two-turn algorithm. For five or more glasses there is no algorithm that guarantees the bell will ring in a finite number of turns.

A further generalization allows k glasses (instead of two) out of the n glasses to be examined at each turn. An algorithm can be found to ring the bell in a finite number of turns as long as k ≥ (1 − 1/p)n where p is the greatest prime factor of n.


Crossing the Bridge Puzzle

Puzzle: 

Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?

Puzzle Solution:

It is 17 mins.
1 and 2 go first, then 1 comes back. Then 7 and 10 go and 2 comes back. Then 1 and 2 go again, it makes a total of 17 minutes.

5 Pirates Fight for 100 Gold Coins Puzzle

Puzzle: 

There are 5 pirates in a ship. Pirates have hierarchy C1, C2, C3, C4 and C5.C1 designation is the highest and C5 is the lowest. These pirates have three characteristics : a. Every pirate is so greedy that he can even take lives to make more money.  b. Every pirate desperately wants to stay alive. c. They are all very intelligent.There are total 100 gold coins on the ship. The person with the highest designation on the deck is expected to make the distribution. If the majority on the deck does not agree to the distribution proposed, the highest designation pirate will be thrown out of the ship (or simply killed). The first priority of the pirates is to stay alive and second to maximize the gold they get. Pirate 5 devises a plan which he knows will be accepted for sure and will maximize his gold. What is his plan?

Solution:
To understand the answer,we need to reduce this problem to only 2 pirates. So what happens if there are only 2 pirates. Pirate 2 can easily propose that he gets all the 100 gold coins. Since he constitutes 50% of the pirates, the proposal has to be accepted leaving Pirate 1 with nothing.

Now let’s look at 3 pirates situation, Pirate 3 knows that if his proposal does not get accepted, then pirate 2 will get all the gold and pirate 1 will get nothing. So he decides to bribe pirate 1 with one gold coin. Pirate 1 knows that one gold coin is better than nothing so he has to back pirate 3. Pirate 3 proposes {pirate 1, pirate 2, pirate 3} {1, 0, 99}. Since pirate 1 and 3 will vote for it, it will be accepted.

If there are 4 pirates, pirate 4 needs to get one more pirate to vote for his proposal. Pirate 4 realizes that if he dies, pirate 2 will get nothing (according to the proposal with 3 pirates) so he can easily bribe pirate 2 with one gold coin to get his vote. So the distribution will be {0, 1, 0, 99}.

Smart right? Now can you figure out the distribution with 5 pirates? Let’s see. Pirate 5 needs 2 votes and he knows that if he dies, pirate 1 and 3 will get nothing. He can easily bribe pirates 1 and 3 with one gold coin each to get their vote. In the end, he proposes {1, 0, 1, 0, 98}. This proposal will get accepted and provide the maximum amount of gold to pirate 5.

Other Way:-

Puzzle2

5 pirates of different ages have a treasure of 100 gold coins.

On their ship, they decide to split the coins using this scheme:

The oldest pirate proposes how to share the coins, and ALL pirates (including the oldest) vote for or against it.

If 50% or more of the pirates vote for it, then the coins will be shared that way. Otherwise, the pirate proposing the scheme will be thrown overboard, and the process is repeated with the pirates that remain.

As pirates tend to be a bloodthirsty bunch, if a pirate would get the same number of coins if he voted for or against a proposal, he will vote against so that the pirate who proposed the plan will be thrown overboard.

Assuming that all 5 pirates are intelligent, rational, greedy, and do not wish to die, (and are rather good at math for pirates) what will happen?

Solution 2
The oldest pirate will propose a 98 : 0 : 1 : 0 : 1 split, in other words the oldest pirate gets 98 coins, the middle pirate gets 1 coin and the youngest gets 1 coin.

Let us name the pirates (from oldest to youngest): Alex, Billy, Colin, Duncan and Eddie.

Working backwards:

2 Pirates: Duncan splits the coins 100 : 0 (giving himself all the gold). His vote (50%) is enough to ensure the deal.

3 Pirates: Colin splits the coins 99 : 0 : 1. Eddie will accept this deal (getting just 1 coin), because he knows that if he rejects the deal there will be only two pirates left, and he gets nothing.

4 Pirates: Billy splits the coins 99 : 0 : 1 : 0. By the same reasoning as before, Duncan will support this deal. Billy would not waste a spare coin on Colin, because Colin knows that if he rejects the proposal, he will pocket 99 coins once Billy is thrown overboard. Billy would also not give a coin to Eddie, because Eddie knows that if he rejects the proposal, he will receive a coin from Colin in the next round anyway.

5 Pirates: Alex splits the coins 98 : 0 : 1 : 0 : 1. By offering a gold coin to Colin (who would otherwise get nothing) he is assured of a deal.

(Note: In the final deal Alex would not give a coin to Billy, who knows he can pocket 99 coins if he votes against Alex's proposal and Alex goes overboard. Likewise, Alex would not give a coin to Duncan, because Duncan knows that if he votes against the proposal, Alex will be voted overboard and Billy will propose to offer Duncan the same single coin as Alex. All else equal, Duncan would rather see Alex go overboard and collect his one coin from Billy.)


Tuesday, March 29, 2016

3 Employee Average salary

Problem:-

How can three employees calculate the average of their salaries without knowing other’s salary

Solution:-

Let's say the three co-workers are A, B, and C and their individual salaries are Sa, Sb, and Sc respectively. For knowing the average of their salaries without disclosing their own salaries to each other, they follow these steps:-
A adds a random amount, say Ra to his own salary and gives that to B (B won't be able to know A's salary as he has added a random amount known to him only). In this case, B will receive the figure (Sa + Ra) from A.
B does the same and gives the final amount to C (without showing that to A). Now C will get the figure (Sa + Ra + Sb + Rb).
C does the same and gives the final figure to A (without showing it to B). Now, A will receive the figure (Sa + Ra + Sb + Rb + Sc + Rc).
Now A subtracts his random amount and gives the final figure to B (without showing that to C). B will now receive the figure (Sa + Sb + Rb + Sc + Rc).
B subtracts his random amount and gives the final figure to C (without showing it to A). C will receive the figure (Sa + Sb + Sc + Rc).
C subtracts his random amount and then the figure becomes (Sa + Sb + Sc). It's shown to everyone and by they get to know the average simply by dividing this figure by 3. Cool... isn't it?

It's important to note here that at every stage (except the very last where C subtracts his random amount), only two co-workers communicating each other should know the fugures and not the third one.

We can apply the same technique to know the average of more than 3 people as well. We just need to remember that at every stage only two people should share the figures and rest other should not be communicated that. What are you waiting for? Find the average salary of your team. No one needs to disclose his/her own salary

Burning Rope Timer Puzzle

Puzzle:


A man has two ropes of varying thickness (Those two ropes are not identical, they aren’t the same density nor the same length nor the same width). Each rope burns in 60 minutes. He actually wants to measure 45 mins. How can he measure 45 mins using only these two ropes.
He can’t cut the one rope in half because the ropes are non-homogeneous and he can’t be sure how long it will burn.



Solution:

He will burn one of the rope at both the ends and the second rope at one end. After half an hour, the first one burns completely and at this point of time, he will burn the other end of the second rope so now it will take 15 mins more to completely burn. so total time is 30+15 i.e. 45mins.

Grandma and Cake – Logical Puzzle

Puzzle: 

You are on your way to visit your Grandma, who lives at the end of the valley. It’s her anniversary, and you want to give her the cakes you’ve made. Between your house and her house, you have to cross 5 bridges, and as it goes in the land of make believe, there is a troll under every bridge! Each troll, quite rightly, insists that you pay a troll toll. Before you can cross their bridge, you have to give them half of the cakes you are carrying, but as they are kind trolls, they each give you back a single cake.

How many cakes do you have to leave home with to make sure that you arrive at Grandma’s with exactly 2 cakes?

Solution:

2 Cakes

How?
At each bridge you are required to give half of your cakes, and you receive one back. Which leaves you with 2 cakes after every bridge.

Hint:-

Let u initially start wid 'x' cakes
. After first bridge u have x/2+1

After second bridge x+6/4
After crossing third x+30/16
After fourth bridge x+62/32
After fifth bridge x+126/64...

Now we know we hv exactly 2 cakes after crossing fifth bridge.. so put it equal to 2

u get x=2...

So, we start with 2 from grandma, the troll will take one cake to make it 1 and then double it => which makes it 2 again.
This shows that 2 remains 2 only (no effect of bridges) and even if the question had asked for 1000 bridges, we'll have 2 cakes.

Probability of picking 2 socks of same color

Problem:
There are 6 pairs of black socks and 6 pairs of white socks.What is the probability to pick a pair of black or white socks when 2 socks are selected randomly in darkness.



Solution:

Ways to pick any 2 socks from 24 socks = 24C2
Ways to pick 2 BLACK socks from 12 BLACK socks = 12C2

Probability of picking 2 BLACK socks (P1)= 12C2 / 24C2 = 66/276
Probability of picking 2 WHITE socks (P2)= 12C2 / 24C2 = 66/276

Probability of picking any 2 same color socks = P1+P2 = 66/276 + 66/276 = 11/23

River Crossing Puzzle

Problem:
Sailor Cat needs to bring a wolf, a goat, and a cabbage across the river. The boat is tiny and can only carry one passenger at a time. If he leaves the wolf and the goat alone together, the wolf will eat the goat. If he leaves the goat and the cabbage alone together, the goat will eat the cabbage.
How can he bring all three safely across the river?

River crossing puzzle

Solution:

The trick to this puzzle is that you can keep wolf and cabbage together. So the solution would be

The sailor will start with the goat. He will go to the other side of the river with the goat. He will keep goat there and will return back and will take cabbage with him on the next turn. When he reaches the other side he will keep the cabbage there and will take goat back with him.

Now we will take wolf and will keep the wolf at the other side of the river along with the cabbage. He will return back and will take goat along with him. This way they all will cross the river.

Probability of getting one rupee coin from bag

Problem:

A bag contains (x) one rupee coins and (y) 50 paise coins. One coin is taken from the bag and put away. If a coin is now taken at random from the bag, what is the probability that it is a one rupee coin?

Answers:

Case I: Let the first coin removed be one rupee coin One rupee coins left = (x – 1) Fifty paise coins left = y. Probability of getting a one rupee coin in the first and second draw = x/(x + y) × (x – 1)/(x – 1 + y)
Case II: Let the first coin removed be fifty paise coin One rupee coins left = x Fifty paise coins left = y – 1. Probability of getting a fifty paise coin in the first and one rupee coin in second draw
= y / (x + y) × x / (x + y – 1)
Total probability = sum of these two = x/(x + y) [after simplification].

Hint

it doesn’t make any differnce if we take out all the coins . the probablity will remain same , because we dont know about the withdrawled coin….:)

Handshake Problem

Problem:

At a party, everyone shook hands with everybody else. There were 66 handshakes. How many people were at the party?

This question is asked in Infosys written.

Solution:

Lets say there are n persons
1st person shakes hand with everyone else: n-1 times(n-1 persons)
2nd person shakes hand with everyone else(not with 1st as its already done): n-2 times
3rd person shakes hands with remaining persons: n-3So total handshakes will be = (n-1) + (n-2) + (n-3) +…… 0
= (n-1)*(n-1+1)/2 = (n-1)*n/2 = 66
= n^2 -n = 132
=(n-12)(n+11) = 0;
= n = 12 OR n =-11
-11 is ruled out so the answer is 12 persons.

Camel and Bananas Puzzle

Puzzle: 

The owner of a banana plantation has a camel. He wants to transport his 3000 bananas to the market, which is located after the desert. The distance between his banana plantation and the market is about 1000 kilometer. So he decided to take his camel to carry the bananas. The camel can carry at the maximum of 1000 bananas at a time, and it eats one banana for every kilometer it travels.

What is the most bananas you can bring over to your destination?

Camel and Banana Puzzle

Solution:

First of all, the brute-force approach does not work. If the Camel starts by picking up the 1000 bananas and try to reach point B, then he will eat up all the 1000 bananas on the way and there will be no bananas left for him to return to point A.

<---p1---><--------p2-----><-----p3---->
  1. A---------------------------------------->B

So we have to take an approach that the Camel drops the bananas in between and then returns to point A to pick up bananas again.

Since there are 3000 bananas and the Camel can only carry 1000 bananas, he will have to make 3 trips to carry them all to any point in between.


When bananas are reduced to 2000 then the Camel can shift them to another point in 2 trips and when the number of bananas left are <= 1000, then he should not return and only move forward.

In the first part, P1, to shift the bananas by 1Km, the Camel will have to


  1. Move forward with 1000 bananas – Will eat up 1 banana in the way forward
  2. Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
  3. Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward
  4. Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
  5. Will carry the last 1000 bananas from point a and move forward – will eat up 1 banana

Note: After point 5 the Camel does not need to return to point A again.

So to shift 3000 bananas by 1km, the Camel will eat up 5 bananas.

After moving to 200 km the Camel would have eaten up 1000 bananas and is now left with 2000 bananas.

Now in the Part P2, the Camel needs to do the following to shift the Bananas by 1km.


  1. Move forward with 1000 bananas – Will eat up 1 banana in the way forward
  2. Leave 998 banana after 1 km and return with 1 banana – will eat up this 1 banana in the way back
  3. Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward

Note: After point 3 the Camel does not need to return to the starting point of P2.

So to shift 2000 bananas by 1km, the Camel will eat up 3 bananas.

After moving to 333 km the camel would have eaten up 1000 bananas and is now left with the last 1000 bananas.

The Camel will actually be able to cover 333.33 km, I have ignored the decimal part because it will not make a difference in this example.

Hence the length of part P2 is 333 Km.

Now, for the last part, P3, the Camel only has to move forward. He has already covered 533 (200+333) out of 1000 km in Parts P1 & P2. Now he has to cover only 467 km and he has 1000 bananas.

He will eat up 467 bananas on the way forward, and at point B the Camel will be left with only 533 Bananas.

Monday, March 28, 2016

13 Caves And A Thief Puzzle

Problem:

There are 13 caves arranged in a circle. There is a thief  in one of the caves. Each day the the thief can move to any one of adjacent cave or can stay in smae cave in which he was staying the previous day. And each day, cops are allowed to enter any two caves of their choice.

What is the minimum number of days to guarantee in which cops can catch the thief?

13-caves-and-a-thief-puzzle-150x150


Note:
Thief may or may not move to adjacent cave.
Cops can check any two caves, not necessarily be adjacent.

Solution:

Lets assume the thief is in cave C1 and going clockwise and cops start searching from cave C13 and C12 on your first day.
Cave C13 and C11 on second day,
C13 and C10 on third day and so on till C13 and C1 on 12th day.
So basically the aim is to check C13 everyday so that if thief tries to go anti clockwise you immediately catch it and if goes clockwise cops will catch him in maximum 12 days (this include the case where he remains in Cave C1).

Answer is 12.

It can be done in 7 days. One cop should move clockwise & other Anti-clockwise starting from the same cave on the day 1.

Hats And IIT Students

Problem:-

The riddle is Nine IIT students were sitting in a classroom. Their professor wanted them to test. Next day the professor told all of his 9 students that he has 9 hats, The hats either red or black color. He also added that he has at least one hat with red color and the no. of black hats is greater than the no. of red hats. The professor keeps those hats on their heads and ask them tell me how many red and black hats the professor have? Obviously students can not talk to each other or no written communication, or looking into each other eyes; no such stupid options and no tricks.
Professor goes out and comes back after 20 minutes but nobody was able to answer the question. So he gave them 10 more minuets but the result was the same. So he decides to give them final 5 minutes. When he comes everybody was able to answer him correctly.
So what is the answer? and why?

Answer:
After first interval of 20 minutes :
Lets assume that their is 1 hat of red color and 8 hats of black color. The student with red hat on his head can see all 8 black hats, so he knows that he must be wearing a red hat.
Now we know that after first interval nobody was able to answer the prof that means our assumption is wrong. So there can not be 1 red and 8 black hats.
After second interval of 10 minutes :
Assume that their are 2 hats of red color and 7 hats of black color. The students with red hat on their head can see all 7 black hats and 1 red hat, so they know that they must be wearing a red hat.
Now we know that after second interval nobody was able to answer the prof that means our assumption is again wrong. So there can not be 2 red and 7 black hats.
After third interval of final 5 minutes :
Now assume that their is 3 hats of red color and 6 hats of black color. The students with red hat on their head can see all 6 black hats and 2 red hats, so they know that they must be wearing a red hat.
Now we know that this time everybody was able to answer the prof that means our assumption is right.So there are 3 red hats and 6 black hats.Now as everybody gave the answer so there can be a doubt that only those 3 students know about it how everybody came to know ?
Then here is what i think, the professor gave them FINAL 5 minutes to answer, so other guys will think that the professor expects the answer after 3rd interval (according to prof it must be solved after 3 intervals), so this is the clue for others.

Case 1. 1 Red Hat 8 Black Hat
The guy with Red Hat can answer it in second.

Case 2. 4 Red Hat 5 Black Hat
Students with Black Hat can answer in second.

Case 3. 2 Red Hat 7 Black Hat
Students with Red Hat can answer in minute.
Students with Red Hat will wait for second to see whether the other student with Red Hat is coming with the answer (1,8) or not if he does not then he must be seeing a Red Hat.

Case 4. 3 Red Hat 6 Black Hat
Students with Red Hat can answer in minute
Students with Red Hat will wait for minute to see whether the other students with Red Hat is coming with the answer (2,7)(as above) or not if he does not then they must be seeing two Red Hat. Wich mean there are three Red Hat.


100 Doors Puzzle

Problem :

You have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6). the third time, every 3rd door (door #3, #6, #9), ec, until you only visit the 100th door.

What state are the doors in after the last pass? Which are open which are closed?

100 doors toggle puzzle


Solution:

You can figure out that for any given door, say door #38, you will visit it for every divisor it has. so  has 1 & 38, 2 & 19. so on pass 1 i will open the door, pass 2 i will close it, pass 19 open, pass 38 close. For every pair of divisors the door will just end up back in its initial state. so you might think that every door will end up closed? well what about door #9. 9 has the divisors 1 & 9, 3 & 3. but 3 is repeated because 9 is a perfect square, so you will only visit door #9, on pass 1, 3, and 9… leaving it open at the end. only perfect square doors will be open at the end.

Age of 3 children – Mathematical Puzzle

Problem:
Two old friends, Jack and Bill, meet after a long time.
Jack: Hey, how are you man?
Bill: Not bad, got married and I have three kids now.
Jack: That’s awesome. How old are they?
Bill: The product of their ages is 72 and the sum of their ages is the same as your birth date.
Jack: Cool… But I still don’t know.
Bill: My eldest kid just started taking piano lessons.
Jack: Oh now I get it.

How old are Bill’s kids?

Solution:

This is a very good logical problem. To do it, first write down all the real possibilities that the number on that building might have been. Assuming integer ages one get get the following which equal 72 when multiplied:

2, 2, 18 – sum = 22
2, 4, 9 – sum = 15
2, 6, 6 – sum = 14
2, 3, 12 – sum = 17
3, 4, 6 – sum = 13
3, 3, 8 – sum = 14
1, 8, 9 – sum = 18
1, 3, 24 – sum = 28
1, 4, 18 – sum = 23
1, 2, 36 – sum = 39
1, 6, 12 – sum = 19

The sum of their ages is the same as your birth date. That could be anything from 1 to 31 but the fact that Jack was unable to find out the ages, it means there are two or more combinations with the same sum. From the choices above, only two of them are possible now. For any other number, the answer is unique and the Jack would have known after the second clue. So he asked for a third clue. The clue that the eldest kid just started taking piano lessons is really just saying that there is an “oldest”, meaning that the younger two are not twins.

2, 6, 6 – sum(2, 6, 6) = 14
3, 3, 8 – sum(3, 3, 8 ) = 14

Hence, the answer is that the elder is 8 years old, and the younger two are both 3 years old.
The answer is 3, 3 and 8.

Prisoners and Hats Puzzle

Problem:

Four prisoners are arrested for a crime, but the jail is full and the jailer has nowhere to put them. He eventually comes up with the solution of giving them a puzzle so if they succeed they can go free but if they fail they are executed.

The jailer puts three of the men sitting in a line. The fourth man is put behind a screen (or in a separate room). He gives all four men party hats. The jailer explains that there are two black and two white hats; that each prisoner is wearing one of the hats; and that each of the prisoners is only to see the hats in front of them but not on themselves or behind. The fourth man behind the screen can’t see or be seen by any other prisoner. No communication between the prisoners is allowed.
If any prisoner can figure out and say to the jailer what color hat he has on his head all four prisoners go free. If any prisoner suggests an incorrect answer, all four prisoners are executed. The puzzle is to find how the prisoners can escape, regardless of how the jailer distributes the hats.

prisoners and hat puzzle

Solution:

Prisoner A and B are in the same situation – they have no information to help them determine their hat colour so they can’t answer. C and D realise this.

Prisoner D can see both B and C’s hats. If B and C had the same colour hat then this would let D know that he must have the other colour.

When the time is nearly up, or maybe before, C realises that D isn’t going to answer because he can’t. C realises that his hat must be different to B’s otherwise D would have answered. C therefore concludes that he has a black hat because he can see B’s white one.

10 Coins Puzzle

Problem: 

You are blindfolded and 10 coins are place in front of you on table. You are allowed to touch the coins, but can’t tell which way up they are by feel. You are told that there are 5 coins head up, and 5 coins tails up but not which ones are which. How do you make two piles of coins each with the same number of heads up? You can flip the coins any number of times.

Solution:

Make 2 piles with equal number of coins. Now, flip all the coins in one of the pile.

How this will work? lets take an example.

So initially there are 5 heads, so suppose you divide it in 2 piles.

Case:

P1 : H H T T T
P2 : H H H T T

Now when P1 will be flipped
P1 : T T H H H

P1(Heads) = P2(Heads)

Another case:

P1 : H T T T T
P2 : H H H H T

Now when P1 will be flipped
P1 : H H H H T

P1(Heads) = P2(Heads)