Tabs

Sunday, January 31, 2016

Cut 2 equal parts of cake


Given the cake with a irregular piece removed.  How can you cut the cake in two equal parts with one straight line cut of a knife.

Answer:-

Out Of the Box – Cut the cake Horizontally

Cut the cake Horizontally – Two equal pieces- Upper half and Lower Half.

Well, of course the upper half will have the decorations and frosting and all that stuff but please do not consider that.


please leave comments if you have any questions.

How much of a loss did the shopkeeper take?


A lady buys goods worth Rs 200 from a shop, whose shopkeeper is selling the goods with zero profit.
  • The lady gives him a Rs 1000 note.      
  •  The shopkeeper gets the change from the next shop, keeps Rs 200 for himself, and returns Rs 800 to the lady.
  •  Later the shopkeeper of the next shop comes with the Rs 1000 note saying “fake note” and takes his money back.
      How much of a loss did the shopkeeper take?

Answer:-

Rs.1000 LOSS

EXPLANATION -

Transaction 1 (Lady and Shopkeeper 1)

Lady to shopkeeper  =    Rs. 1000(FAKE)                            = Rs 0             (EARN Rs.0)

Shopkeeper to Lady  =    Rs. 200 goods + Rs. 800 change  = Rs.1000    (EARN  –Rs.1000 ) – LOSS

Shopkeeper 2 given and took back Rs1000   –   NO NEED TO CONSIDER

FINALLY-

Shopkeeper 1 loss:     Rs.200 goods+ Rs.800 change – Rs. 1000 fake=  Rs.1000

please leave comments if you have any questions.

Friday, January 29, 2016

How many such operations are necessary to correctly label the boxes?


The first box has two white balls. The second box has two black balls. The third box has a white and a black ball.
Boxes are labeled but all labels are wrong!
You are allowed to open one box, pick one ball at random, see its color and put it back into the box, without seeing the color of the other ball.
How many such operations are necessary to correctly label the boxes?


Answer:-

Just One!
Because we know all labels are wrong.
So the BW box must be either BB or WW. Selecting one ball from BW will let you know which.
And the other two boxes can then be worked out logically.


please leave comments if you have any questions.

1 Ball is defected of 8 can you find in 2 weighs?

There are 8 balls. 7 of them weigh the same. 1 of them has a different weight, (you don’t know if it’s heavier or lighter). How do you find the odd ball with 2 weighs?

Answer:-

Tricky question, Right?

NO, It is not possible.

This can be explained by information theory. We need to extract 16 units of information (A ball may be light or heavy -2 units and it can be one of 8 balls). However, we gain just 3 units of information (light, heavy or equal).

So, we need ceil[log3(16)] = 3 weighing.

In the similar question you linked to,
we had 24 units of information and so we needed ceil[log3(24)] = 3 weighing.

please leave comments if you have any questions.

1 Ball is heavier of of 8 balls, can you find which one?

You have 8 balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. 
 
How can you find the ball that is heavier by using a balance and only two weighing?


Answer:-

Divide the balls into the following groups: (1,2,3),(4,5,6),(7,8)
Step 1.
Weigh (1,2,3) against (4,5,6)
Two possible outcomes:
The two groups are equally heavy. (Case A)
One of these groups is heavier than the other. (Case B)
Case A
Weigh 7 against 8.  Now you have identified the heavier ball in 2 weighing.

Case B

Take the heavier group (assume it to be (1,2,3)), take any two balls and weigh them against each other. Either one of these is heavier else the third ball is.


please leave comments if you have any questions.

Bad King and Wine Bottles puzzle

 A bad king has 1000 bottles of very expensive wine. A neighboring King plots to kill the bad king and sends a servant to poison the wine. Unfortunately the bad king’s guards catch the servant after he has only poisoned one bottle. Alas, the guards don’t know which bottle but know that the poison is so strong that even if diluted 1,000,000 times it would still kill the king. Furthermore, it takes one month to have an effect. The bad king decides he will get some of the prisoners in his vast dungeons to drink the wine. Being a clever bad 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 at his anniversary party in 5 weeks time. Explain How ?


Answer:-

Number the bottles 1 to 1000, and write the number in binary format.

bottle 1 = 0000000001
bottle 250 = 0011111010
bottle 1000 = 1111101000

Now take your prisoner’s 1 through 10 and

 Let prisoner 1 take a sip from every bottle that has a 1 in its least significant bit.
Let prisoner 10 take a sip from every bottle with a 1 in its most significant bit. etc.

Prisoner      – 10 9 8 7 6 5 4 3 2 1
Bottle 924  – 1  1  1 0 0 1 1 1 0 0
 
In this, bottle #924 would be sipped by 10,9,8,5,4 and 3

That way if bottle #924 was the poisoned one, only those prisoners would die.
After four weeks,
line the prisoners up in their bit order and read each living prisoner as a 0 bit and each dead prisoner as a 1 bit.
The number that you get is the bottle of wine that was poisoned.
 please leave comments if you have any questions.

Defective stack of coins puzzle


There are 10 stacks of 10 coins each.
Each coin weights 10 gms. However, one stack of coins is defective and each coin in that stack weights only 9 gms.
What is the minimum number of weights you need to take to find which stack is defective? How?

Answer:-

SOLUTION -   1 Measurement Only.

EXPLANATION -

We will take,
1 coin from the first stack,
2 coins from the second,
3 from the third
and
so on.
In total we will have 55 coins.
If all of them were non-defective, they would weigh 550 gms.
If stack 1 is defective, the measure would read 549 gms.
If stack 2 is defective, you will read 548 gms.
and so on.

So by taking one measurement you can identify, which is the defective stack.
please leave comments if you have any questions.

Measure 9 minutes from 2 hourglasses puzzle


Using only a Four-minute hourglass and a seven-minute hourglass,
How will you measure exactly nine minutes?

Restriction:- Without the process taking longer than nine minutes.

Answer:-

We measure 7 Minute from One Hourglass. We reverse it at 7th minute.
And, 4+4=8 Minutes from Second Hourglass:- 8 Minutes
8(from 1)-7(From 2) = 1 Minute  :-1 Minutes, Hence total is-
TOTAL = 9 MINUTES


EXPLANATION-

0 Minutes – Start both hourglass at the same time.
4 Minutes – The four minute glass runs out. Flip the four minute glass.
7 Minutes – The seven minute glass runs out. Flip the seven minute glass.
8 Minutes – The four minute glass runs out; the seven minute glass has been running for one minute. Flip the seven minute glass.
9 Minutes – The seven minute glass runs out.

Thursday, January 28, 2016

What is Probability of having a boy

In a country where everyone wants a boy(A country like India), each family continues having babies till they have a boy.
After some time, what is the proportion of boys to girls in the country? 
Note that probability of having a boy or a girl is same.

Answer:-

Assume there are C number of couples so there would be C boys. The number of girls can be calculated by the following method.

Number of girls = 0*(Probability of 0 girls) + 1*(Probability of 1 girl) + 2*(Probability of 2 girls) + …
Number of girls = 0*(C*1/2) + 1*(C*1/2*1/2) + 2*(C*1/2*1/2*1/2) + …
Number of girls = 0 + C/4 + 2*C/8 + 3*C/16 + …
Number of girls = C

(using mathematical formulas; it becomes apparent if you just sum up the first 4-5 terms)

The proportion of boys to girls is 1 : 1.

Another Explanation -

Let us take an example that in a country there are 40 couples and considering same probability of a girl and a boy 25 of them will have a boy as their first child.
Here B = 20 G = 20      (B = No.of Boys, G = No. of Girls)

Now for the rest of 20 couples 10 of them will have a Boy as their second child and rest 10 will have girl again as their second child.
So here B = 30(20 + 10)
G =    30(20 + 10)

The no. of boys and girls will always be same. The answer is shocking but true.
Please leave your comments below for any query.....

2 Eggs and 100 floor


There is a building of 100 floors
-If an egg drops from the Nth floor or above it will break.
-If it’s dropped from any floor below, it will not break.
You’re given 2 eggs.
To find N how many minimum numbers of egg drops you need to make?
What strategy should you adopt to minimize the number egg drops it takes to find the solution?

Do not forget to leave comments if you have any query......

Answer:

This follows the below logic.
Say, the egg breaks at floor n we try to find out by going (N-1) till the first floor by doing linear search.
Say for example, I throw the egg from 10th floor, and it breaks, I will go to floor 1 to 9 to find out the floor..
Then I would try the same logic for every 10 floors thereby setting a worst case scenario of 19 chances.. I.e. 10,20,30,40,50,60,70,80,90,100,91,92,93,94,95,96,97,98,99
To find optimum solution, let’s try this:
If for every n, egg doesn't break, instead of going to next n, go to N-1, this would save us one drop as we are doing a linear search with second egg when egg1 breaks…
So the series would look something like this-

N + (N-1) + (N-2) + (N-3) +…+ 1
 
Now this is a series which is equal to N(N+1)/2
Now since it is given that the egg may or may not break from 100th floor..
We can write it as-

N (N+1) / 2 >= 100

And n=14(approx)
So we should start from 14 then move up N-1 to 13 floor I.e. 27,39…
So the floors from where the drop needs to be done are:
 14,27,39,50,60,69,77,84,90,95,99,100
So the answer is 14.
leave the comment if you do not agree with answers?