Monday, 12 November 2012

Logic puzzle no.1

0 comments

Question:
if apple is for 40 cents, banana is for 60 cents and grapefruit is for 80 cents then what pear is for???


Solution:
apple, 2 vowels=2*20=40
banana, 3 vowels=3*20=60
grapefruit, 4 vowels=4*20=80
pear, 2 vowels=2*20=40


POST YOUR OPINION IF YOU HAVE BETTER SOLUTION

Tuesday, 9 October 2012

2 eggs dropped from 100th floor with Best solution

0 comments

Problem Statement:

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. Find N, while minimizing the number of drops for the worse case.
Solution:
Observation: Regardless of how we drop Egg1, Egg2 must do a linear search. Eg, if the Egg1
breaks between floor 10 and 15, we have to check every floor in between with the Egg2
The Approach:
A First Try: Suppose we drop an egg from the 10th floor, then the 20th, …
»» In the first egg breaks on the first drop (Floor 10), then we have at most 10 drops total.
»» If the first egg breaks on the last drop (Floor 100), then we have at most 19 drops total
(floors 1 through 100, then 91 through 99).

Recent comments

Send Quick Massage

Name

Email *

Message *

Recent posts

Total Pageviews

Blog Archive