Professional Documents
Culture Documents
Now finding out the optimal one we can see that we could have done it in either 15
or 14 drops only but how can we find the optimal one. From the above table we can
see that the optimal one will be needing 0 linear trials in the last step.
So we could write it as
(1+p) + (1+(p-1))+ (1+(p-2)) + .........+ (1+0) >= 100.
Let 1+p=q which is the answer we are looking for
q (q+1)/2 >=100
Solving for 100 you get q=14.
So the answer is: 14
Drop first orb from floors 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100... (i.e. move
up 14 then 13, then 12 floors, etc) until it breaks (or doesn't at 100).
2. This problem is also called Jelly Beans problem. You have three jars that
are all mislabeled. one contains apples, another has grapes, and the third
has a mix of both.
Now you are allowed to open any one jar and you can able to see one fruit.
[ The jar you are open may contain one fruit or two fruit. but you could
able to see only one fruit and you can't find weather the opened jar has
one or two fruit]. How could you fix the labels on the jars ?
Need to open Apple+Orange jar. If it has apple. then it should be labeled as Apple.
The jar which has label Orange should be labeled as "Apple+Orange" and the last
one i.e. apple should be as "Orange"
3. 5 pirates of different ages have a treasure of 100 gold coins.
On their ship, they decide to split the coins using this scheme:
The oldest pirate proposes how to share the coins, and ALL pirates
(including the oldest) vote for or against it.
If 50% or more of the pirates vote for it, then the coins will be shared that
way. Otherwise, the pirate proposing the scheme will be thrown
overboard, and the process is repeated with the pirates that remain.
As pirates tend to be a bloodthirsty bunch, if a pirate would get the same
number of coins if he voted for or against a proposal, he will vote against
so that the pirate who proposed the plan will be thrown overboard.
Assuming that all 5 pirates are intelligent, rational, greedy, and do not
wish to die, (and are rather good at math for pirates) what will happen?
we need to reduce this problem to only 2 pirates. So what happens if there are only
2 pirates. Pirate 2 can easily propose that he gets all the 100 gold coins. Since he
constitutes 50% of the pirates, the proposal has to be accepted leaving Pirate 1 with
nothing.
Now lets look at 3 pirates situation, Pirate 3 knows that if his proposal does not get
accepted, then pirate 2 will get all the gold and pirate 1 will get nothing. So he
decides to bribe pirate 1 with one gold coin. Pirate 1 knows that one gold coin is
better than nothing so he has to back pirate 3. Pirate 3 proposes {pirate 1, pirate 2,
pirate 3} {1, 0, 99}. Since pirate 1 and 3 will vote for it, it will be accepted.
If there are 4 pirates, pirate 4 needs to get one more pirate to vote for his proposal.
Pirate 4 realizes that if he dies, pirate 2 will get nothing (according to the proposal
with 3 pirates) so he can easily bribe pirate 2 with one gold coin to get his vote. So
the distribution will be {0, 1, 0, 99}.
Smart right? Now can you figure out the distribution with 5 pirates? Lets see. Pirate
5 needs 2 votes and he knows that if he dies, pirate 1 and 3 will get nothing. He can
easily bribe pirates 1 and 3 with one gold coin each to get their vote. In the end, he
proposes {1, 0, 1, 0, 98}. This proposal will get accepted and provide the maximum
amount of gold to pirate 5.
4. Four prisoners are arrested for a crime, but the jail is full and the jailer
has nowhere to put them. He eventually comes up with the solution of
giving them a puzzle so if they succeed they can go free but if they fail
they are executed.
The jailer puts three of the men sitting in a line. The fourth man is put
behind a screen (or in a separate room). He gives all four men party hats
(as in diagram). The jailer explains that there are two red and two blue
hats. The prisoners can see the hats in front of them but not on
themselves or behind. The fourth man behind the screen can't see or be
seen by any other prisoner. No communication between the men is
allowed.
If any prisoner can figure out and say (out loud) to the jailer what colour
hat he has on his head all four prisoners go free. The puzzle is to find how
the prisoners can escape.
For the sake of explanation let's label the prisoners in line order A B and C. Thus B
can see A (and his hat colour) and C can see A and B.
The prisoners know that there are only two hats of each colour. So if C observes that
A and B have hats of the same colour, C would deduce that his own hat is the
opposite colour. However, If A and B have hats of different colours, then C can say
nothing. The key is that prisoner B, after allowing an appropriate interval, and
knowing what C would do, can deduce that if C says nothing the hats on A and B
must be different. Being able to see A's hat he can deduce his own hat colour. (The
fourth prisoner is irrelevant to the puzzle: his only purpose is to wear the fourth
hat).
5. You are given two candles of equal size, which can burn 1 hour each. You have to
measure 90 minutes with these candles. (There is no scale or clock). Also u r given a
lighter.
First light up the two ends of the 1st candle. When it will burn out light up one end of the second
candle. (30+60=90)
10. What is the height of room if after entering the room with a watch ur head
strikes a hanging bulb?
Oscillate the hanging bulb. Calculate the time period for one complete
oscillation by Simple Harmonic Motion (SHM) of the handing bulb. Put it in the
formula T=2 * 3.14 * (L/G)^1/2
L will be the length of the hanging thread.
Add the L with ur height to get the height of the room.
11. Write an algorithm to find out a number from an array of numbers where only one
number occurs once and rest all occurs twice.
XOR has these two properties,You can checkout the properties of XOR here.
A (+) A = 0
A (+) 0 = A
A (+) B (+) C = A (+) C (+) B
Thus all the numbers with two occurrences will become 0 after XOR and Number
with only one occurrence will remain.
12. 16 men can finish a job in 16 days, If after 4 days manpower is
increased by 14, then How many days will be needed to finish the job?
16 men can do a job in 16 days, after 4 days remaining work can be finished in 12 days by 16
men. But now as we have 14 more persons to do the job, so it can be finished in 12*16/30 = 6.4
days.
More explanation:16 men can finish a job in 12 days.
30 men can do the same job in 12*16/30 days.
13. How many degrees (if any) are there in the angle between the hour
and minute hands of a clock when the time is a quarter past three?
This comes from the fact that the hour hand doesn't stay still whilst the minute
hand is catching up. So let us consider the angles clockwise from 12 o'clock so.
12 o'clock = 0
1 o'clock = 30
2 o'clock = 60
3 o'clock = 90
4 o'clock = 120
The simplest way to think of this is that clearly each hour is made up of 30 and
that the hour hand will have moved one quarter of an hour past three o'clock. x
30 = 7.5
minute moves by 360- hour moves by 30
minute moves by 90 hour moves by ?
14. A regular clock has an hour and minute hand. At 12 midnight the
hands are exactly aligned. When is the next time they will exactly align or
overlap?
At our first overlap just after five past one the Minute Hand will have done one full
rotation plus the bit we are interested in. The Hour Hand will have done just a part
rotation of 't' times it's speed.
Hour Hand = Minute Hand
30t = 360t - 360
t = 12(t - 1)
11t = 12
t = 12/11
= 1.090909.... hours
= 1h 5min 27.272727..seconds
Probably the most elegant solution is to realise that the overlap will happen 11
times in a 12 hour period and so the answer is just 1/11th of 12 hours. It's difficult to
divine this. But it makes sense. Just as we reasoned our first overlap will be at just
after 1:05 we can reason that our last will be just before 10:55. Our overlaps will be
at just after 1:05, a bit more after 2:10, even more after 3:15 and so on (actual
times give at the end) but since our last is a bit before 10:55 there will be no
overlap whilst the Hour Hand is indicating 11
Full List of Overlap Times
01:05:27
02:10:55
03:16:22
04:21:49
05:27:16
06:32:44
07:38:11
08:43:38
09:49:05
10:54:33
12:00:00
15. You are given a set of scales and 12 marbles. The scales are of the old
balance variety. That is, a small dish hangs from each end of a rod that is
balanced in the middle. The device enables you to conclude either that the
contents of the dishes weigh the same or that the dish that falls lower has
heavier contents than the other.
The 12 marbles appear to be identical. In fact, 11 of them are identical,
and one is of a different weight. Your task is to identify the unusual
marble and discard it. You are allowed to use the scales three times if you
wish, but no more.
Note that the unusual marble may be heavier or lighter than the others.
You are asked to both identify it and determine whether it is heavy or
light.
Most people seem to think that the thing to do is weigh six coins against six coins,
but if you think about it, this would yield you no information concerning the
whereabouts of the only different coin or the nature of it's difference as we already
know that one side will be heavier than the other. It's worth mentioning that if this is
used as an interview question this observation, by itself, is likely to get you a good
portion of the way there.
So that the plan can be followed, let us number the coins from 1 to 12. For the first
weighing let us put on the left pan coins 1,2,3,4 and on the right pan coins 5,6,7,8.
There are two possibilities. Either they balance, or they don't. If they balance, then
the different coin is in the group 9,10,11,12. So for our second one possibility is to
weigh 9,10,11 against 1,2,3
(1) They balance, in which case you know 12 is the different coin, and you just
weigh it against any other to determine whether it is heavy or light.
(2) 9,10,11 is heavy. In this case, you know that the different coin is 9, 10, or 11,
and that that coin is heavy. Simply weigh 9 against 10; if they balance, 11 is the
heavy coin. If not, the heavier one is the heavy coin.
(3) 9,10,11 is light. Proceed as in the step above, but the coin you're looking for is
the light one.
That was the easy part.
What if the first weighing 1,2,3,4 vs 5,6,7,8 does not balance? Then any one of
these coins could be the different coin. Now, in order to proceed, we must keep
track of which side is heavy for each of the following weighings.
Suppose that 5,6,7,8 is the heavy side. We now weigh 1,5,6 against 2,7,8. If they
balance, then the different coin is either 3 or 4. Weigh 4 against 9, a known good
coin. If they balance then the different coin is 3, otherwise it is 4. The direction of
the tilts can tell us whwther the offending coin is heavier or lighter.
Now, if 1,5,6 vs 2,7,8 does not balance, and 2,7,8 is the heavy side, then either 7 or
8 is a different, heavy coin, or 1 is a different, light coin.
For the third weighing, weigh 7 against 8. Whichever side is heavy is the different
coin. If they balance, then 1 is the different coin. Should the weighing of 1,5, 6 vs
2,7,8 show 1,5,6 to be the heavy side, then either 5 or 6 is a different heavy coin or
2 is a light different coin. Weigh 5 against 6. The heavier one is the different coin. If
they balance, then 2 is a different light coin.
16. You are a bug sitting in one corner of a cubic room. You wish to walk
(no flying) to the extreme opposite corner (the one farthest from you).
Describe the shortest path that you can walk.
The problem phrased differently is that we have to get from point A to point B only
moving along the walls.
The shortest route is shown it is A-H-B where H is the mid point of D-E.
The length of this route can easily be calculated, assume the cube has sides of
length 1 unit (it doesn't matter what these units are, meters, feet, what ever) The
distance A-H is the hypotenuse of a triangle 1 x a quick bit of pythag tells us that
A-H equals sqrt(5/4). Similarly H-B has the same length hence the total length is 2 x
sqrt(5/4) this is actually equal to the square root of 5
17. There are 100 light bulbs lined up in a row in a long room. Each bulb
has its own switch and is currently switched off. The room has an entry
door and an exit door. There are 100 people lined up outside the entry
door. Each bulb is numbered consecutively from 1 to 100. So is each
person.
Person No. 1 enters the room, switches on every bulb, and exits. Person
No. 2 enters and flips the switch on every second bulb (turning off bulbs 2,
4, 6...). Person No. 3 enters and flips the switch on every third bulb
(changing the state on bulbs 3, 6, 9...). This continues until all 100 people
have passed through the room.
What is the final state of bulb No. 64? And how many of the light bulbs are
illuminated after the 100th person has passed through the room?
First think who will operate each bulb, obviously person #2 will do all the even
numbers, and say person #10 will operate all the bulbs that end in a zero. So who
would operate for example bulb 48:
Persons numbered: 1 & 48, 2 & 24, 3 & 16, 4 & 12, 6 & 8 ........
That is all the factors (numbers by which 48 is divisible) will be in pairs. This means
that for every person who switches a bulb on there will be someone to switch it off.
This willl result in the bulb being back at it's original state.
So why aren't all the bulbs off?
Think of bulb 36:The factors are: 1 & 36, 2 & 13, 6 & 6
Well in this case whilst all the factors are in pairs the number 6 is paired with it's
self. Clearly the sixth person will only flick the bulb once and so the pairs don't
cancel. This is true of all the square numbers.
There are 10 square numbers between 1 and 100 (1, 4, 9, 16, 25, 36, 49, 64, 81 &
100) hence 10 bulbs remain on.
18. What is the smallest positive integer that leaves a remainder of 1
when divided by 2, remainder of 2 when divided by 3, a remainder of 3
when divided by 4, and so on up to a remainder of 9 when divided by 10?
The key to this is to realise that if a number N (eg 104) is to leave a remainder, say
4 when divided by 5 then N + 1 (ie 105) is exactly divisible by 5, similarly if a
number (eg 87) is to leave a remainder 7 when divided by 8 then N + 1 (ie 88) is
exactly divisible by 8:Therefore in our question N + 1 is divisible by 2, 3, 4, 5, 6, 7, 8, 9 & 10
As stated N + 1 is divisible by 2, 3, 4, 5, 6, 7, 8, 9 & 10 so clearly one solution would
be 10! (ie 10*9*8*7*6*5*4*3*2) but this is not the lowest possible. Follow the logic
below...
N + 1 must be a multiple of 2
N + 1 must be a multiple of 4 but if it is a multiple of 2 & 4 it is necessarily a
multiple of 8
N + 1 must be a multiple of 5 but if it is a multiple of 2 & 5 it is necessarily a
multiple of 10
N + 1 must be a multiple of 6 but if it is a multiple of 2 & 9 (18) it is necessarily a
multiple of 6
N + 1 must be a multiple of 7
N + 1 must be a multiple of 9
Hence 2 x 4 x 5 x 7 x 9 = 2520 is a multiple of 2, 3, 4, 5, 6, 7, 8, 9 & 10
19.In a country where everyone wants a boy, each family continues having
babies till they have a boy. After some time, what is the proportion of boys
2,
4,
6,
3,
4,
3,
8,
3,
4,
2,
6,
18 sum(2, 2, 18) = 22
9 sum(2, 4, 9) = 15
6 sum(2, 6, 6) = 14
12 sum(2, 3, 12) = 17
6 sum(3, 4, 6) = 13
8 sum(3, 3, 8 ) = 14
9 sum(1,8,9) = 18
24 sum(1, 3, 24) = 28
18 sum(1, 4, 18) = 23
36 sum(1, 2, 36) = 39
12 sum(1, 6, 12) = 19
The sum of their ages is the same as your birth date. That could be anything from 1
to 31 but the fact that Jack was unable to find out the ages, it means there are two
or more combinations with the same sum. From the choices above, only two of them
are possible now.
2, 6, 6 sum(2, 6, 6) = 14
3, 3, 8 sum(3, 3, 8 ) = 14
Since the eldest kid is taking piano lessons, we can eliminate combination 1 since
there are two eldest ones. The answer is 3, 3 and 8.
21. You are imprisoned in a chamber with two doors as the only exit.only one is door to outside.
There are two guards standing before you: one guard always lies; the other always tells the truth.
You can ask only one question to save your life. What should you ask?
If I asked the other guardian which door leads to heaven, what would he tell me?"
The door that the guardian specfies will be the one that leads to hell, so you know
the other one leads to heaven.
This is because if you asked the guardian who tells the truth this question, he will
tell the truth in that the other guardian will lie, and show you the door to hell. If you
asked the guardian that always lies, he will lie by showing you the door to hell,
because the other guardian would show you to door to hell
22. You are standing at the centre of a circular field of radius R. The field
has a low wire fence around it. Attached to the wire fence (and restricted
to running around the perimeter) is a large, sharp-fanged, hungry dog.
You can run at speed v, while the dog can run four times as fast. What is
your running strategy to escape the field?
Firstly I, like everyone else thought that the most likely technique would be to stand
in the middle and run away from the dog. This would leave you running a distance R
and the dog running R this would take you a time R/v and him R/(4v) so clearly he
would get there before you as:
R/v > R/(4v)
So clearly we need to be closer to the edge than just in the middle, let us work out
how far away from the centre we have to be in order that we have the advantage
over the dog. Let our distance from the centre be xR where x is a number less than
one eg. if R were 10m and we were 1.5m from the centre then x=0.15 Assuming
that we can get the dog on the opposite side of the circle to us (I'll come back to
that,) then the distance we must run is (1 - x)R where as the dog must always run
R we can equate the time associated with these distances, remembering the dog
runs at 4v.
(1 - x)R/v = R/(4v)
x = 0.2146
Any closer than this to the center (ie x being smaller,) and the dog will still be able
to catch us, we need to start with a value of x greater than 0.2146. Now how do we
get the dog on the opposite side? Well if we run in circles around the centre clearly
if we are close enough to the center then the dog will not be able to keep up.
Consider if i am at a distance of x = 0.1 and running in a circle, the dog will not be
able to match my position on the outside of the circle. Infact if I am running in a
circle of x < 0.25 the dog will not be able to keep up (remember the dog runs 4
times my speed.) So we pretty much have it.
The strategy is to run in a circle of 0.2146R < radius < 0.25R until the dog is on the
opposite side then make for the fence like the clappers.
23. How can this be true???? Have a look at the picture (click to enlarge.)
All the lines are straight, the shapes that make up the top picture are the
same as the ones in the bottom picture so where does the gap come
from????
24. A man is in a rowing boat floating on a lake, in the boat he has a brick.
He throws the brick over the side of the boat so as it lands in the water.
The brick sinks quickly. The question is, as a result of this does the water
level in the lake go up or down?
When an object is floating be it because it is something less dense than water, say
polystyrene, or because it is in a boat, say a brick and the whole boat is less dense
than water, then it displaces in the water it's own mass. For example a 10 Kg lump
of lead on a boat will force the boat to sink by a volume equivalent to 10Kg of water.
Hence displacing 10Kg of water. Or indeed forcing the water level to raise by an
amount equivalent to 10Kg of water. (Like when you get in the bath.)
When an object sinks in water it necessarily displaces it's own volume.
So when the brick is in the boat it is displacing it's own mass equivalence in water.
When the brick is thrown over the side it is displacing it's own volume in water.
So which of these is greater?
Well we know the brick to be more dense than water because it sinks. So the
volume of water equivalent to the mass of the brick is greater than the volume of
the brick. And so less water is displaced after than before. Hence...
The Water Level Goes Down!!!!
If that is not clear then consider the following example: you need to know that 1
litre of water has a mass of 1Kg:-