Puzzle : 12 balls 3 weighing

Well,

It has been sometime since my absence on this blog. I have been on vacation actually. Here is a typical puzzle.

Problem : 12 balls are given. All but one are of equal weight. You do not know whether the defective ball is lighter or heavier than the normal balls. You are given a comparison balance. You can use the balance only 3 times. How would you find out which is the defective ball? Is it heavier or lighter?

Solution :

There may be more than one solution, however, I am describing here the one which struck me. We will divide balls in groups of four. Thus we will have three groups, A, B and C. Without loss of generality , put group A and B on comparison balance.

case 1 : A = B

In this case, we know that defective ball is in group C. Put (C1.C2,C3) and ( A1,A2,A3) on comparison balance.

case 1a : (C1,C2,C3) = ( A1,A2,A3)

Clearly, C4 is the defective ball. Compare it with A1 and find out whether it is heavier or lighter.

case 1b : (C1,C2,C3) < ( A1,A2,A3)

Now, we know that defective ball is lighter. Compare C1 and C2. if they are unequal, we know which one is defective depending upon which one is lighter. If they are equal, we know that C3 is the lighter defective ball.

case 1c : (C1,C2,C3) > (A1,A2,A3)

Now, it is obvious that defective ball is heavier. Carry out the same procedure as described in case 1b, to find out which one is heavier defective ball.
case 2 : A > B

From this observation we can deduce that one of the ball in group A is heavier or one of the ball in group B is lighter. Now, compare ( A4, B3,B4) and ( B1,B2,C1).

case 2a : ( A4,B3,B4) > ( B1,B2,C1)

This tells us that either A4 is heavier or one of B1-B2 is lighter. Compare B1 and B2. If they are equal then A4 is the heavier defective ball. If not, we know which one is defective depending on which one is lighter.

case 2b : (A4,B3,B4) < ( B1,B2,C1)

This tells us that one of B3 and B4 is lighter defective ball.Compare B3 and B4 and find out which one is defective.

case 2c : (A4,B3,B4) = (B1,B2,C1)

This is an easier case. Now we know that one of A1,A2,A3 is defective and heavier. Compare A1 and A2 if they are equal A3 is defective, if not, the heavier of the two is defective.

case 3 : A < B

Line of reasoning is exactly similar to case 2. ( replace heavier by lighter and vice versa ).

I will soon be posting the answer to the logic related puzzle that is posted earlier.

Tags:

12 Responses to “Puzzle : 12 balls 3 weighing”

  1. Puzzle : 9 balls « Me, Myself and Mathematics Says:

    […] Related post : here […]

  2. sha Says:

    thank you Joshi – my dad, my husband and I myself have spent hours on this puzzle last night. Well, I am the weak link so I “cheated” by googling it online and found your solution. Thanks, I will be able to sleep well today. Thanks.

  3. Microsoft Interview Question for Software Engineer/Developer about Puzzle « GeeksforGeeks Says:

    […] Source: https://sbjoshi.wordpress.com/2008/05/05/puzzle-12-balls-3-weighing/ […]

  4. jonas@krokan.com Says:

    Oops in case b1, you forgot ball C4!

  5. Mohit Says:

    In case 1 if defective pice is in B than I think we have to weight one more time
    Am I rt?

    • Saurabh Joshi Says:

      No, If defective ball is in B we know that B has a lighter ball. (A4,B1,B2) > (B3,B4,C1) tells you either A4 is heavier or B3,B4 is lighter. Compare B3 with B4 and find out which is the case. Similarly if (A4,B1,B2) B)

  6. priyashetty17 Says:

    Hi.. i m not able to understand case 2b and 2c. why was (A4,B3,B4) and ( B1,B2,C1) weighed? What is the logic behind choosing (A4,B3,B4) and ( B1,B2,C1)? y is A mixed B and B mixed with C? Please help me understand.

    • Saurabh Joshi Says:

      Reason for choosing (A4,B3,B2) (call it G1) and (B1,B2,C1) (call it G2) is as follows. From case 2 we know that Either A has a heavier ball or B has a lighter ball. Dividing B into two equal parts achieve the following. If G1 > G2 then we know that either A4 is heavier or B1,B2 is lighter (improvement from saying that A1-A4 is heavier or B1-B4 is lighter). The goal is that for the third weighing only 3 balls needs to be remaining. With G1 > G2 we can find if B1=B2 or not. If B1>B2 then B2 is the lighter defective ball (similarly for B1 < B2). If B1=B2 then A4 is the defective ball. Now, If G1=G2 then we know that A1-A3 has one heavier ball. Compare A1 with A2 and find out which one. Reason from taking a ball from C because from case 2 we know that C does not have a defective ball. 1 ball from A and 4 balls from B makes it 5 balls, so add a ball from C to make it even.

  7. Ramon Says:

    I might have and easier solution:
    Take 2 groups of 5, placing 2 to the side.
    Use the balance:
    -If the two groups of five are the same weight just compare the other two.
    -If not take the heaviest group of 5 and make 2 groups of 2, placing 1 to the side.
    -If the two new groups weight the same the different ball is the one that is in the side.
    -If not take the group of two that weighted more and compare them.

    • Saurabh Joshi Says:

      Your solution assumes that defective ball is heavier. The question is that you do not know if the ball is heavier or lighter. So your solution requires more than 3 weighing.

  8. gareth Says:

    4 0n each side,asume left pan down
    swap 3 balls from the4 with three ok balls,,
    and switch the fourth ball with a ball from the high pan,,

    the 3 ay deductive logic explains itself,gareth stephen colton

Leave a comment