Wednesday 17 August 2016

Measure Time by Hourglass

Problem:
Using only a four-minute hourglass and a seven-minute hourglass, what time can be measured with the process not taking longer than the time we are trying to measure.
A)8 min
B)11 min
C)6 min
D)9 min

Answer:A,B,D

Solution Approach:
 0:00 - Start both at the same time.
4:00 - The four minute glass runs out. Flip the four minute glass.
7:00 - The seven minute glass runs out. Flip the seven minute glass.
8:00 - The four minute glass runs out; the seven minute glass has been running for one minute. Flip the seven minute glass.
9:00 - The seven minute glass runs out.

11:00 -When both of them complete

Next number

Problem

What's the next number in the sequence

10,9,60,90,70,66,96,94,98,...?

Answer:78

Solution Approach:

Ten-3
Nine-4
Sixty-5
Ninety-6
Seventy-7
Sixty six-8
Ninety six-9
Ninety four-10
Ninety eight-11
Seventy eight-12

Measure Time by Burning Ropes

Problem

You have two ropes and a box of matches. Each rope takes exactly one hour to burn, but they may not necessarily burn evenly – i.e., the first half might burn in the first 10 minutes and the second in the remaining 50). Whats the time you can measure using the 2 ropes?

A)1 hr
B)30 min
C)45 min
D)15 min

Answer: All of the above

Solution Approach: 
Light one end of the rope .Measure the time taken for complete burning=1 hr
Light the other rope from both ends.Time taken till the burns meet=30 min
T=60+30/2=45 min
What you need to do is light one from both sides, and simultaneously light the other one from only one side. When the first burns completely, 30 minutes have passed, and the second will be halfway through its burn. Then you light -that- one from the other end, halving its remaining burn time to 15 minutes, and when that one is done you'll have 45 minutes exactly.

Tuesday 16 August 2016

Which offer is better?

Problem

1) You are to make a statement. If the statement is 
true,you get exactly $10. If the statement is false, 
you get either less than or more than $10 but not 
exactly $10.
2) You are to make a statement. Regardless of whether 
the statement is true or false, you get more than $10.
 
Answer: 1
 
Solution Approach:
You should take offer #1, because you can guarantee 
yourself an arbitrarily large amount of money, simply 
by using the following as your statement:

“I will receive neither $10 nor $1000.”

If we assume the statement is true, this leads to a 
contradiction because you would receive $10, by the 
rules.

If we assume the statement is false, then to satisfy 
the falsity of the statement, you must receive either 
$10 or $1000. But since you cannot receive $10 if the 
statement is false, you must receive $1000.

Of course you can use any amount in place of “$1000.”

Train station

Problem

Every day, Joe arrives at the train station from work at 6pm.
His wife leaves home in her car to meet him there at exactly 6pm, and drives him home. One day, Joe gets to the station an hour early, and starts walking home, until his wife meets him on the road. They get home 20 minutes earlier than usual.
How long was he walking?
Distances are unspecified. Speeds are unspecified, but constant.
Output a number which represents the answer in minutes.


Answer: 50 mins

Solution Approach:

They arrived home 20 minutes early.


The twenty minutes were saved on going to the station and returning home.
so 20/2=10
She drove 10 minutes less each way for a total of 20 minutes. He walked 50 minutes.

One Mile on the Globe

Problem

How many points are there on the globe where by walking one mile south, one mile east and one mile north you reach the place where you started?

Answer: infinity

Solution Approach:

Wizards and Drawves

Problem

There is a village of wizards and a village of N dwarves.
Once a year, the wizards go over to the village of dwarves and line all the dwarves up in increasing height order, such that each dwarf can only see the dwarves shorter than himself.
The wizards have an infinite supply of white and black hats. They place either a white or black hat on the head of each dwarf. Then, starting with the tallest dwarf (in the back of the line), they ask each what color hat he is wearing. If the dwarf answers incorrectly, the wizards kill him (the other dwarves can hear his answer, but can’t tell if he was killed or not). What is the most number of dwarves that will be killed using this optimal strategy?
Do note that the dwarves already know that the wizards will do as stated above. So, they can get together and devise an optimal strategy to minimize the people that get killed.


Answer : 1

Solution Approach:

Let white be encoded as 1 and black as 0.
The tallest dwarf sums up the blacks and whites in front of him,divides it by 2 and calls out white or black depending on the remainder 1 or 0
The second one can know his answer

But now the second dwarf can know the color of his own hat by adding up the sum of 0s and 1s ahead of him and finding the remainder with 2 and comparing it with the answer given by the dwarf behind him. If the answer is same, he is wearing a black hat, else he is wearing a white hat, which he calls out with full certainty, and survives.

Hence using this strategy, at most 1 dwarf is killed with probability half.