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

31 Dec 2013

Squares on a Chess Board

Puzzle :
      How many squares are there on a Chess board. ?


64 as answer is wrong !!

Answer:
The Answer is ofcourse not 64. Since Chess boards of size 1x1 , 2x2 , 3x3 ..... 7x7 , 8x8 can be made.
For 1x1
8*8 = 64
For 2x2
7 horizontal and 7 vertical positions are available to place 2x2 chess board.
So we have 7*7= 49 , 2x2 Chess boards
For 3x3
6 horizontal and 6 vertical positions are available to place 2x2 chess board.
So we have 6*6= 36 , 3x3 Chess boards
and so on
1×1 8 x 8 = 64 squares
2×2 7 x 7 = 49 squares
3×3 6 x 6 = 36 squares
4×4 5 x 5 = 25 squares
5×5 4 x 4 = 16 squares
6×6 3 x 3 = 9 squares
7×7 2 x 2 = 4 squares
8×8 1×1 = 1 square
Therefore , total squares are 1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2 + 7^2 + 8^2 = 204 squares

Probablity of Picking socks

Puzzle: 
     Probability of Picking socks of same color.

There are 5 pairs of Black Socks and 5 pairs of White Socks. What is the probability to pick a pair of black or white socks when 2 socks are selected in random.

Answer:
Number of Ways to pick 2 socks from 20 socks = 20C2 = (20*19)/2 = 190
Number of Ways to pick 2 Black socks from 10 socks = 10C2 = (10*9)/2 = 45
Probablity of picking 2 Black socks = 45/190
Similarly ,
Probablity of picking 2 White socks = 45/190
Probablity of picking 2 socks of same color = 45/190 + 45/190
= 9/19

25 Dec 2013

Gold Bar

Puzzle: 
    You have hired a worker to dig Diamond mine for 7 days, and you promise the worker to give Gold Bar of 7 inches as reward , 1 inch per day. What is minimum number of cuts required to give the worker 1 inch of gold bar every day ?

Given 7inch Gold bar:

Fig: 7 inches Gold bar
  7 Inch Gold bar broken in 1 inch , 2 inches and 4 inches

Fig2 : 1inch , 2 inches and 4 inches

Answer:
Day 1: Give 1 inch (+1)
Day 2: Get back 1 inch, give 2 inches(-1, +2)
Day 3: Give 1 inch (2,+1 )
Day 4: Get back 1 inch and 2 inches, give 4 inches (-2,-1,+4)
Day 5: Give inch (4,+1)
Day 6: Get back 1 inch, give 2 inches (-1,4,+2)
Day 7:Give A (4,2,+1)

31 Oct 2013

King and Wine Bottles

Puzzle Problem: 

A king has a stock of 1000 bottles of delightful and very expensive wine. A neighboring queen plots to kill the bad king and sends a servant to poison the wine. Fortunately the king’s guards catch the servant after he has only poisoned one bottle. Now the kind needs to find the poisoned bottle as he cant discard all bottles as they are very expensive and imported. Furthermore, it takes one month to have an effect of the poison. The king decides he will get some of the prisoners in his vast dungeons to drink the wine. Being a clever king he knows he needs to murder no more than 10 prisoners – believing he can fob off such a low death rate – and will still be able to drink the rest of the wine (999 bottles) at his anniversary party in 5 weeks time. Explain what is in mind of the king, how will he be able to do so ?

Hint : Think in terms of binary numbers.

Answer:

-
Bottles will be represented in terms of binary numbers :


BOTTLE
Decimal
Binary
5
101
23
10111
100
1100100
255
11111111
511
111111111
682
1010101010

 10 prisoners will be selected to find out the poisoned bottle
 Each prisoner will be assigned to corresponding to a bit in the Binary Represention.

For e.g. Bottle ,  numbered as 682 will be sipped by



Decimal
Binary
Number
682
1
0
1
0
1
0
1
0
1
0
Prisoners
10
9
8
7
6
5
4
3
2
1


As we can see if the bottle number 682 was poisoned then the prisons 10, 8 , 6 , 4 , 2 would die.
-

28 Oct 2013

Four glasses on a Square table

Puzzle Problem :  (Four glasses on a Square table)

Four glasses are placed on the corners of a square table. Some of the glasses are upright (up) and some upside-down (down). You have to arrange the glasses so that they are all up or all 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.

Answer:

  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.


27 Oct 2013

Hand Shake Problem

Puzzle Problem : (Hand Shake Problem)
Ten people (five couples) go to a party and start shaking hands.
You don't shake your spouse's hand or (of course) your own.
Give number of handshakes that happened at the party.


Answer:

 There are totally 40 handshakes....

First couple handshake with other is 8+8 = 16
Second couple handshake with other except first couple..becuase we already add their handshakes.
so i.e. 6+6 = 12
Third couple handshakes is 4+4 = 8 (minus the first two couples handshake)
Fourth couple handshakes is 2+2 = 4 (minus the first three couples handshake)
Last couple handshakes is 0+0 = 0 (minus the first four couples handshake)

so total 16+12+8+4 = 40

Ants on a Triangle

Puzzle Problem :

There are three ants on a triangle, one at each corner.
At a given moment in time, they all set off for a different corner at random.
What is the probability that they don’t collide ?



Answer:


Let the three ants are A, B, C.
There are two cases when they will not collide, 
the one is when they all move clockwise and the other is when they all move anticlockwise.
 
They will collide if any two ants move towards each other, at the same time the third ant can move in clockwise or in anticlockwise. so for each pair there are 2 such cases. 
And there are 3 pairs possible (A,B), (B,C) and (C,A).
So total 3*2 = 6 cases when they will collide.
So probability that they will not collide is 2/(2+6) i.e. 1/4

Total number of cases = 8

A->B, B->C, C->A
A->B, B->A, C->A
A->B, B->A, C->B
A->B, B->C, C->B
A->C, B->C, C->A
A->C, B->A, C->A
A->C, B->A, C->B
A->C, B->C, C->B

The non-colliding cases are :

A->B, B->C, C->A
A->C, B->A, C->B




4 Mugs Puzzle

Puzzle Problem:
     There are 4 mugs placed upturned on the table.
Each mug have the same number of marbles and a statement about the number of marbles in it. 
The statements are: 
Mug 1 : Two or Three
Mug 2: One or Four
Mug 3: Three or One
Mug 4: One or Two.

Only one of the statement is correct. How many marbles are there under each mug?

Answer:


As it is given that only one of the four statement is correct , the correct number can not appear in more than one statement. It it appears in more than one statement , then more than one statement will be correct.


Number
1
2
3
4
Mug
Mug 2 , Mug 3
Mug 1 , Mug 4
Mug 1 , Mug 3
Mug 2


Hence, there are 4 marbles under each mug.