100 floor building

Question:

Suppose you have two identical toys. Standing in front of a 100 floor building, you want to find out what is the maximum number of floors from which the toy can be dropped without breaking it. What is the minimum number of tries needed to find out this? (the broken toy should not be used again)

.

.

C

A

P

T

A

I

N

I

N

T

E

R

V

I

E

W

.

.

Solution:

We will drop the first toy on floor 14, and it will break. Then we have to test floors 1-13 with the 2nd toy to see where the toy breaks again, and the toy will not break on any of those floors. But since the toy broke on the floor 14, we can conclude that the threshold floor is floor number 14. now, if the toy doesn’t break on 14th floor then we will go to 27th floor and will try again. if it breaks at 27th floor then we will again have trials at 15(because 14th one is already covered), 16, and so on till 26th.. and still doesn’t break, will go to 39th and will repeat the same.

#1 – 14

#2 – 27

#3 – 39

#4 – 50

#5 – 60

#6 – 69

#7 – 77

#8 – 84

#9 – 90

#10 – 95

#11 – 99

#12 – 100

(14 +(14–1) + (14–2) + (14–3) + (14–4) +(14–5) + (14–6) + (14–7) + (14–8) + (14–9) + (14–10) )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s