Easy | Strategy |

An Egg breaks only if dropped from above a threshold floor, within this 100 story building. Every time you drop the egg, it is counted an attempt. You are given two eggs, find an algorithm to deduce the threshold floor, with minimum number of attempts in worst case!

Hint

If we had only 1 egg, we would go linearly from 1 to 100. Having an extra egg gives an opportunity to jump (skip some floors from testing). When 1st egg breaks, second egg moves linearly. Think why first egg should not move in constant jumps, but rather decreasing jumps! This will give 14 steps in the worst case.

Answer

It can be done in 14 steps in the worst case.

Solution

A solution for minimum steps in worst case is the smallest integer greater than or equal to the positive solution of n(n+1)/2=100...which gives 14....

start at 14th floor, if egg breaks start linearly from 1, if it does not break drop the egg from 14+13 = 27th floor, and so on....

My friend was asked only one puzzle in his interview, "3 eggs". He got the job.

start at 14th floor, if egg breaks start linearly from 1, if it does not break drop the egg from 14+13 = 27th floor, and so on....

My friend was asked only one puzzle in his interview, "3 eggs". He got the job.

Source: Quant Interview

Enable Like and Comment Easy | General |

Without explicitly calculating, find out which is bigger: e^Pi or Pi^e?

Answer

e^Pi

Solution

This is a common placement test question. Since e^x = 1 + x…., we have e^x>1+x. Now, conveneintly choosing x = (Pi / e -1) and solving, we get e^Pi > Pi^e.

Another way is to observe for f(x) = x^(1/x), differentiating: f'(x) = f(x)*(1/x^2)*(1- ln x); f is decreasing for x > e so pi^(1/pi) < e^(1/e); hence e^(pi)> pi^(e)

Another approach is to assume e^Pi > Pi^e <=> Pi*lne > e*ln Pi <=> lne/e > lnPi/Pi. Now, notice that f(x) = lnx/x is decreasing function since f'(x) is negative in range (e<x<pi), hence above assumption is true!

Another way is to observe for f(x) = x^(1/x), differentiating: f'(x) = f(x)*(1/x^2)*(1- ln x); f is decreasing for x > e so pi^(1/pi) < e^(1/e); hence e^(pi)> pi^(e)

Another approach is to assume e^Pi > Pi^e <=> Pi*lne > e*ln Pi <=> lne/e > lnPi/Pi. Now, notice that f(x) = lnx/x is decreasing function since f'(x) is negative in range (e<x<pi), hence above assumption is true!

Easy | General |

100 pirates stand in a circle. They start shooting alternately in a cycle such that 1st pirate shoots 2nd, 3rd shoots 4th and so on. They continue in circle till only one pirate is left. Which position should Captain Jack Sparrow stand to survive?

Solution

This is not a puzzle at all, this is apti/maths question, but has become quite common. You can calculate for a N=100, 73rd position is safe. For a general N, find largest m such that 2^m < N. Take t = N-2^m. Then Safe position is 2*t + 1. Please learn this formula. No need to prove it using strong induction. Proof: http://en.wikipedia.org/wiki/Josephus_problem#k.3D2

Source: Written Tests

Enable Like and Comment Easy | Probability |

There is a regular die and a special invisible die. You know that regular die has integers 1 to 6, but don't know what's on the invisible dice. After tossing, I speak the sum of outcome of both die. It so happens that the outcome is an interger between 1 to 12, with equal probability (1/12 each). Can you guess what are the numbers printed on special invisible dice?

Hint

For the sum to be 1, we need atleast 0, and for sum to be 12, what do we need? Can you guess the digits of invisible dice now?

Answer

0 0 0 6 6 6

Solution

Faces of cube have numbers: 0 0 0 6 6 6 . If we compute conditional probability, we get 0 with probabilty (1/2) and 6 with probability (1/2). Hence the sum is 1,2....12 with probability of (1/12) each

Source: Technical Interview

Enable Like and Comment Easy | Probability |

Sheldon says "Suppose I have two children. Younger one is a girl". What is the probability that both children are girls?

"Forget all that, and suppose I have two children, and atleast one of them is a boy". Find probability of two boys.

"Suppose I have two kids, lets call them Bouba and Kiki", says Dr. Cooper, "and suppose Bouba is a girl !" What is the probability that I have two daughters?"

"Forget all that, and suppose I have two children, and atleast one of them is a boy". Find probability of two boys.

"Suppose I have two kids, lets call them Bouba and Kiki", says Dr. Cooper, "and suppose Bouba is a girl !" What is the probability that I have two daughters?"

Answer

1/2, 1/3, 1/3

Solution

First and second are un-ambiguous. Third is debatable as per the interpretation. I believed 1/3, as the names Cooper used were anonymous, and should have given no extra information. But it turns out that Cooper did provide some extra information. He had actually fixed a person (A). Also, calculating the probability in part 3 using conditionals will give 1/2.

Source: Written Test

Enable Like and Comment Latest solved Puzzles

Color Switches Weird Sequences Intersecting Pillars Consecutive sums Scaling a Square Difficulty Level

© BRAINSTELLAR |