Category Archives: weight puzzles

Minimum set of Weights

What is the minimum number of weights needed for a scale that will be able to weigh objects from the weight of one pound to 100 pounds?

SOLUTION :

1) If only one side pan of the balance-scale is used

Weights are :  2^n <100  i.e. {1,2,4,8,16,32,64}  = 7

2) If both side pan of balance-scale is used

Weights are :  3^ n <100  i.e. {1,3,9,27,81}  = 5

Mathematical Explanation –

For each weight, there are three things you can do: put it on the left pan, the right pan, or not on the balance at all.
So, if you have n weights, there are 3^n things you can do with them.
One of those things is not putting any weights on the scale, which is good if you want to weigh a 0-pound object, so really there are only 3^n – 1 arrangements.
Then, for each arrangement there’s also its mirror image (where all the weights are switched to the opposite pan of the scale), so there are at MOST (3^n – 1)/2 arrangements of n weights.
That’s enough to prove that 4 weights can weigh at most 40 different things … 40 is really the upper limit for 4 weights.
With a fifth weight, you should be able to get up to (3^5 – 1)/2 =121 pounds.


12 balls – odd one out

The Problem:

You have 12 balls identical in size and appearance but 1 is an odd weight (could be either light or heavy).

You have a set scales (balance) which will give 3 possible readings: Left = Right, Left > Right or Left < Right (ie Left and Right have equal weight, Left is Heavier, or Left is Lighter).

You have only 3 chances to weigh the balls in any combination using the scales. Determine which ball is the odd one and if it’s heavier or lighter than the rest. How do you do it?

The Solution:

Number the balls 1, 2, 3, … 10, 11, 12

Start off with them in 3 groups: [1, 2, 3 and 4], [5, 6, 7 and 8] and [9,10,11 and 12]

Weigh 1, 2, 3 and 4 vs 5, 6, 7 and 8 with 3 possible outcomes:

1. If they balance then 9,10,11,12 have the odd ball, so weigh 6,7,8 vs 9,10,11 with 3 possible outcomes:
1a If 6,7,8 vs 9,10,11 balances, 12 is the odd ball. Weigh it against any other ball to determine if heavy or light.
1b If 9,10,11 is heavy then they contain a heavy ball. Weigh 9 vs 10, if balanced then 11 is the odd heavy ball, else the heavier of 9 or 10 is the odd heavy ball.
1c If 9,10,11 is light then they contain a light ball. Weigh 9 vs 10, if balanced then 11 is the odd light ball, else the lighter of 9 or 10 is the odd light ball.
2. If 5,6,7,8 > 1,2,3,4 then either 5,6,7,8 contains a heavy ball or 1,2,3,4 contains a light ball so weigh 1,2,5 vs 3,6,12 with 3 possible outcomes:
2a If 1,2,5 vs 3,6,12 balances, then either 4 is the odd light ball or 7 or 8 is the odd heavy ball. Weigh 7 vs 8, if they balance then 4 is the odd light ball, or the heaviest of 7 vs 8 is the odd heavy ball.
2b If 3,6,12 is heavy then either 6 is the odd heavy ball or 1 or 2 is the odd light ball. Weigh 1 vs 2, if balanced then 6 is the odd heavy ball, or the lighest of 1 vs 2 is the odd light ball.
2c If 3,6,12 is light then either 3 is light or 5 is heavy. Weigh 3 against any other ball, if balanced then 5 is the odd heavy ball else 3 is the odd light ball.
3. If 1,2,3,4 > 5,6,7,8 then either 1,2,3,4 contains a heavy ball or 5,6,7,8 contains a light ball so weigh 5,6,1 vs 7,2,12 with 3 possible outcomes:
3a If 5,6,1 vs 7,2,12 balances, then either 8 is the odd light ball or 3 or 4 is the odd heavy ball. Weigh 3 vs 4, if they balance then 8 is the odd light ball, or the heaviest of 3 vs 4 is the odd heavy ball.
3b If 7,2,12 is heavy then either 2 is the odd heavy ball or 5 or 6 is the odd light ball. Weigh 5 vs 6, if balanced then 2 is the odd heavy ball, or the lighest of 5 vs 6 is the odd light ball.
3c If 7,2,12 is light then either 7 is light or 1 is heavy. Weigh 7 against any other ball, if balanced then 1 is the odd heavy ball else 7 is the odd light ball.

Contaminated Pills

This is one of the puzzle which has been asked in so many interviews.Saying from personal experience 😉

“You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?”

SOLUTION:

1. Mark the jars with numbers 1, 2, 3, 4, and 5.
2. Take 1 pill from jar 1, take 2 pills from jar 2, take 3 pills from jar 3, take 4 pills from jar 4 and take 5 pills from jar 5.
3. Put all of them on the scale at once and take the measurement.
4. Now, subtract the measurement from 150 ( 1*10 + 2*10 + 3*10 + 4*10 + 5*10)
5. The result will give you the jar number which has contaminated pill.