0% found this document useful (0 votes)
25 views13 pages

Puzzle 2

Uploaded by

Farhan Mirza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views13 pages

Puzzle 2

Uploaded by

Farhan Mirza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Puzzle 1 | (Pay an employee using a gold rod

of 7 units ?)

An employee works for an employer for 7 days. The employer has a gold rod of 7
units. How does the employer pay to the employee, so that the number of employee’s
rod units increases by one at the end of each day? The employer can make at most 2
cuts in the rod.
(Hint- after the end of the day employee’s can’t spend any part of rod)
Solution:
The employer can pay for seven days by making 2 cuts in a way that he has 3 rods of
size 1, 2 and 4.
1st Day: Employer gives 1 unit cut.
2nd day: Takes back 1 unit cut from employee given on the first day and gives 2 unit
cut.
3rd Day: Gives 1 unit and then the employer is left with 4 unit rod lengths.
4th Day: Takes back cuts of 1 and 2 units. Gives the cut of 4 units.
5th Day: Gives cut of 1 unit to the employee.
6th Day: Takes back cut of 1 unit and gives a cut of 2 units.
7th Day: Gives cut of 1 unit to the employee.

Puzzle 2 | (3 Bulbs and 3 Switches)



There is a room with a door (closed) and three light bulbs inside the room. Outside the
room, there are three switches, connected to the bulbs. You may manipulate the
switches as you wish, but once you open the door you can’t change them. All bulbs
are in working condition and you can open the door only once. Identify each switch
with respect to its bulb.
Solution:
Let the bulbs be X, Y, and Z
Turn on switch X for 5 to 10 minutes. Turn it off and turn on switch Y. Open the door
and touch the light bulb.
1. the light is on from the bulb, it is Y
Now we will check the other two off bulbs
2. the bulb which is hot, is X
3. the bulb which is cold, is Z
Puzzle 3 | (Camel and Banana Puzzle)
A person has 3000 bananas and a camel. The person wants to transport the maximum
number of bananas to a destination which is 1000 KMs away, using only the camel as
a mode of transportation. The camel cannot carry more than 1000 bananas at a time
and eats a banana every km it travels. What is the maximum number of bananas that
can be transferred to the destination using only camel (no other mode of transportation
is allowed).
Solution:
Let’s see what we can infer from the question:
 We have a total of 3000 bananas.
 The destination is 1000KMs
 Only 1 mode of transport.
 Camel can carry a maximum of 1000 banana at a time.
 Camel eats a banana every km it travels.
With all these points, we can say that person won’t be able to transfer any banana to
the destination as the camel is going to eat all the banana on its way to the destination.
But the trick here is to have intermediate drop points, then, the camel can make
several short trips in between.
Also, we try to maintain the number of bananas at each point to be multiple of 1000.
Let’s have 2 drop points in between the source and destination.
With 3000 bananas at the source. 2000 at a first intermediate point and 1000 at 2nd
intermediate point.
Source————–IP1—————–IP2———————-Destination
3000 x km 2000 y km 1000 z km
——————–> | —————> | ———————–>
<——————- | <————– |
——————-> | —————> |
<—————— | |
——————-> | |
 To go from source to IP1 point camel has to take a total of 5 trips 3 forward and 2
backward. Since we have 3000 bananas to transport.
 The same way from IP1 to IP2 camel has to take a total of 3 trips, 2 forward and 1
backward. Since we have 2000 bananas to transport.
 At last from IP2 to a destination only 1 forward move.
Let’s see the total number of bananas consumed at every point.
 From the source to IP1 its 5x bananas, as the distance between the source and IP1
is x km and the camel had 5 trips.
 From IP1 to IP2 its 3y bananas, as the distance between IP1 and IP2 is y km and
the camel had 3 trips.
 From IP2 to destination its z bananas.
We now try to calculate the distance between the points:
1. 3000 – 5x = 2000 so we get x = 200
2. 2000-3y = 1000 so we get y = 333.33 but here the distance is also the number of
bananas and it cannot be fraction so we take y =333 and at IP2 we have the
number of bananas equal 1001, so its 2000-3y = 1001
3. So the remaining distance to the market is 1000 -x-y =z i.e 1000-200-333 => z
=467.
Now, there are 1001 bananas at IP2. However the camel can carry only 1000 bananas
at a time, so we need to leave one banana behind.
So from IP2 to the destination point camel eats 467 bananas. The
remaining bananas are 1000-467=533.

So the maximum number of bananas that can be transferred is 533.


Another Approach:
If the camel doesn’t eat a banana while returning, which means when it doesn’t have a
banana, then the maximum number of bananas that can be transferred will be 833.
Let us divide the journey into 3 parts. First, the camel takes 1000 bananas and travels
333 KMs and puts the remaining bananas (1000-333 = 667) at first intermediate place
and returns back to the source. Similarly, two more times, the camel takes 1000
bananas and travel for 333 KMs and put there remaining. Now, the total numbers of
bananas are 2001 at the first intermediate place.
Again, the camel takes 1000 bananas and travels 500 KMs and puts the remaining
bananas(1000-500=500) at second intermediate place and returns back to first
intermediate place. Similarly one more times, the camel takes 1000 bananas and
travels for 500 KMs and put there remaining bananas. Now, the total number of
bananas is 1000 at the second intermediate place.
At last, the camel takes 1000 bananas and travels the remaining journey to 167 KMs.
Thus, the total number of bananas is 833 at the final destination.
So, the maximum number of bananas can be transferred is 833, if the camel doesn’t
eat a banana while returning.
Puzzle 4 | (100 Prisoners with Red/Black Hats)

100 prisoners in jail are standing in a queue facing in one direction. Each prisoner is
wearing a hat of color either black or red. A prisoner can see hats of all prisoners in
front of him in the queue, but cannot see his hat and hats of prisoners standing behind
him.
The jailer is going to ask color of each prisoner’s hat starting from the last prisoner in
queue. If a prisoner tells the correct color, then is saved, otherwise executed. How
many prisoners can be saved at most if they are allowed to discuss a strategy before
the jailer starts asking colors of their hats.

Answer:
At-most 99 prisoners can be saved and the 100th prisoner has 50-50 chances of being
executed.
The idea is that every prisoner counts number of red hats in front of him.
100th prisoner says red if the number of red hats is even. He may or may not be saved,
but he conveys enough information to save 99th prisoner.
The 99’th prisoner decides his answer on the basis of answer of 100’th prisoner’s
answer. There are following possibilities and 99’th prisoner can figure out color of his
hat in every case.
If 100’th prisoner said ‘Red’ (There must have been even number of red hats in front
of him)
a) If 99’th prisoner sees even number of red hats in front of him, then his color is
black.
b) If 99’th prisoner sees odd number of red hats in front of him, then his color is red.
If 100’th prisoner said ‘Black’ (There must have been odd number of red hats in front
of him)
a) If 99’th prisoner sees even number of red hats in front of him, then his color is
Red.
b) If 99’th prisoner sees odd number of red hats in front of him, then his color is
Black.
The 98’th prisoner decides his answer on the basis of answer of 99’th prisoner’s
answer and uses same logic.
Similarly other prisoners from 97 to 1 are saved.
OR
They could come up with a strategy where initially two random guys stands at the
front, then if both of them have the same color then the third will stand behind them,
and in between them if their hats are of different color, now the 4th guy will also do
the same, he will stand at a position where hat color changes, else stands at the last
position and so on, so at last they will be sorted with same hat colors, 50 in front 50 at
back, last guy tells the color of the hat of the guy in front of him and the 51st guy
changes the color of his hat.

Puzzle 5 | (Strategy for a 2 Player Coin Game)


Puzzle: Consider a two-player coin game where each Player A and Player B gets the
turn one by one. There is a row of even number of coins, and a player on his/her turn
can pick a coin from any of the two corners of the row. The player that collects coins
with more value wins the game. Develop a strategy for the player making the first turn
i.e, Player A, such that he/she never loses the game. Note that the strategy to pick a
maximum of two corners may not work. In the following example, the first player,
Player A loses the game when he/she uses a strategy to pick a maximum of two
corners.
Example:
Initial row: 18 20 15 30 10 14
Player A picks 18, now row of coins is: 20,15,30,10,14

After first pick: 20 15 30 10 14


Player B picks 20, now row of coins is: 15,30,10,14

After second pick: 15 30 10 14


Player A picks 15, now row of coins is

After third pick: 30 10 14


Player B picks 30, now row of coins is

After 4th pick: 10 14


Player A picks 14, now row of coins is

Last pick: 10
Player B picks 10, game over.

The total value collected by Player B is more (20 +


30 + 10) compared to first player (18 + 15 + 14).
So the second picker, Player B wins.
Solution: The idea is to count the sum of values of all even coins and odd
coins, compare the two values. The player that makes the first move can
always make sure that the other player is never able to choose an even coin
if the sum of even coins is higher. Similarly, he/she can make sure that the
other player is never able to choose an odd coin if the sum of odd coins is
higher. So here are the steps to a proper algorithm of either winning the
game or getting a tie:
 Step 1: Count the sum of all the coins in the even places(2nd, 4th, 6th
and so on). Let the sum be “EVEN”.
 Step 2: Count the sum of all the coins in the odd places(1st, 3rd, 5th and
so on). Let the sum be “ODD”.
 Step 3: Compare the value of EVEN and ODD and this is how the first
player, here Player A must begin its selection.
1. if (EVEN > ODD), start choosing from the right-hand corner and select
all the even placed coins.
2. if (EVEN < ODD), start choosing from the left-hand corner and select
all the odd placed coins.
3. if (EVEN == ODD), use a dynamic strategy to maximize the value
based on the immediate and subsequent possible values (see
approach below).
Example: Suppose you are given the following rows of coins:
18 20 15 30 10 14
Coins at even places: 20, 30, 14 Coins at odd places: 18, 15, 10 These
places are fixed independent of whether the choice of selection must begin
from the left or the right-hand side.
Step 1: Sum of all even placed coins = 20 + 30 + 14 = 64
Step 2: Sum of all odd placed coins = 18 + 15 + 10 = 43
Step 3: Comparing the even and the odd placed coins where EVEN > ODD
Therefore, Player A must start selecting from the right-hand side and choose
all the even-placed coins every time(here they are 14, 30 and 20). So first
picker, Player A picks 14. Now, irrespective of whether the second Player B
starts selecting from the left-hand side i.e., 18 or from the right-hand side
i.e., 10, the even placed coins i.e., 14, 30 and 20 are booked for the Player
A. Therefore, be it any situation that arises, the first picker Player A will
always win the game.
Illustration: Here are the illustrations to both the cases of pick by Player B:
Case 1: When Player B starts picking from the left corner.

Case 2: When Player B starts picking from the right corner after Player A.
Puzzle 6 | 8 balls problem
Last Updated : 18 Jan, 2023


Puzzle: You are provided with 8 identical balls and a measuring instrument. 7 of the
eight balls are equal in weight and one of the eight given balls is defective and weighs
less. The task is to find the defective ball in exactly two measurements.
Puzzle 7– The Lion and the Unicorn
Question:
In the forest, a girl encounters a lion and a unicorn. Every Monday,
Tuesday, and Wednesday, the lion tells lies, but on the other days, he
tells the truth. The unicorn tells the truth the rest of the week but lies
on Thursdays, Fridays, and Saturdays. The lion confessed to the girl,
“Yesterday I was lying.” So was I, the unicorn said. When is it today?

Puzzle 8 | The Burning Candles



Problem Statement: Given two candles. Each of them burns for one hour. They burn
unevenly in different parts though. In addition, let’s have a box of matches. Measure
45 minutes and 15 minutes.
Solution:
 Step1: Both ends of the first candle should be lit, but only one end of the second
candle should be lit. After the first candle has burned fully in 30 minutes, the
remaining time is 30 minutes to burn the other candle with one end unburned.
 Step2: Now lit both the ends of the 30-min(remaining) length of candle 2, it will
burn in 15 minutes. Now let’s have a look at the solution candle-wise.
o Candle1: The first candle is lit from the end, So it will be completely
burned in 30 minutes.
o Candle2: After 30 minutes, the two candles will be half burned. Now,
let’s lit the second end also and candle 2 will be burned completely in 15
minutes.
Conclusion:
 Now one can see the measurements.
 15 minutes: Candle 2 when lit from both ends, burned in 15 minutes. That’s how it
can be calculated in 15 minutes.
 45 minutes: Candle 2 + Candle 1 time taken for both the candles to be burned is
equivalent to 45 minutes i.e., (30 + 15) minutes.

Puzzle 9 | Weight of Heavy Ball



Puzzle: There are 2187 balls, out of which 1 is heavy. Find the minimum number of
attempts the balls have to be weighed for finding out the heavy ball.
Solution: The minimum amount of measurements needed to be done will be
equal to 7 times.
2187 = 3^7
1. Step 1: Divide the 2187 balls into 3 equal groups of 729 each, let’s say
C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on
the other. This can give rise to 3 conditions:
 Condition 1: C1 equals C2, which means C3 has the heaviest ball
 Condition 2: C1 < C2, which means C2 has the heaviest ball.
 Condition 3: C1 > C2, which means C1 has the heaviest ball.
Let’s suppose Condition 1 follows up, and C3 has the heaviest ball.
Step 2: Now divide C3 again into 3 equal groups of 243 each, naming them again C1, C2 and C3. Put C1
on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:

 Condition 1: C1 equals C2, which means C3 has the heaviest ball

 Condition 2: C1 < C2, which means C2 has the heaviest ball.

 Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 2 follows up, and C2 has the heaviest ball.
Step 3: Now divide C2 again into 3 equal groups of 81 each, naming them again C1, C2 and C3. Put C1 on
one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:

 Condition 1: C1 equals C2, which means C3 has the heaviest ball

 Condition 2: C1 < C2, which means C2 has the heaviest ball.

 Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 3 follows up, and C1 has the heaviest ball.

You might also like