Skip to main content
added 1247 characters in body
Source Link
JonTheMon
  • 9.9k
  • 37
  • 56

Process:

010 1011 0110 0111
000 0000 0000 0000
                 - See 1 (left)
010 1011 0110 0111
000 0000 0000 0001
                -  See 1 (left)
010 1011 0110 0111
000 0000 0000 0011
               -   See 0 (right)
010 1011 0110 1011
000 0000 0000 0011
              -    See 0 (right)
010 1011 0111 0011
000 0000 0000 0011
            -      See 1 (left)
010 1011 0111 0011
000 0000 0001 0011
           -       See 1 (left)
010 1011 0111 0011
000 0000 0011 0011
          -        See 0 (right)
010 1011 1011 0011
000 0000 0011 0011
         -         See 1 (left)
010 1011 1011 0011
000 0000 1011 0011
       -           See 1 (left)
010 1011 1011 0011
000 0001 1011 0011
      -            See 0 (right)
010 1101 1011 0011
000 0001 1011 0011
     -             See 1 (left)
010 1101 1011 0011
000 0101 1011 0011
    -              See 0 (right)
011 0101 1011 0011
000 0101 1011 0011
  -                See 1 (left)
011 0101 1011 0011
001 0101 1011 0011
 -                 Just 1 remaining (left)
011 0101 1011 0011

Process:

010 1011 0110 0111
000 0000 0000 0000
                 - See 1 (left)
010 1011 0110 0111
000 0000 0000 0001
                -  See 1 (left)
010 1011 0110 0111
000 0000 0000 0011
               -   See 0 (right)
010 1011 0110 1011
000 0000 0000 0011
              -    See 0 (right)
010 1011 0111 0011
000 0000 0000 0011
            -      See 1 (left)
010 1011 0111 0011
000 0000 0001 0011
           -       See 1 (left)
010 1011 0111 0011
000 0000 0011 0011
          -        See 0 (right)
010 1011 1011 0011
000 0000 0011 0011
         -         See 1 (left)
010 1011 1011 0011
000 0000 1011 0011
       -           See 1 (left)
010 1011 1011 0011
000 0001 1011 0011
      -            See 0 (right)
010 1101 1011 0011
000 0001 1011 0011
     -             See 1 (left)
010 1101 1011 0011
000 0101 1011 0011
    -              See 0 (right)
011 0101 1011 0011
000 0101 1011 0011
  -                See 1 (left)
011 0101 1011 0011
001 0101 1011 0011
 -                 Just 1 remaining (left)
011 0101 1011 0011
Source Link
JonTheMon
  • 9.9k
  • 37
  • 56

The binary of 11111 is 010 1011 0110 0111 and the other pan is effectively 000 0000 0000 0000. Adding the weights is the same as adding 1 to each spot, and we want the two numbers to end up the same.

The scenario that we must avoid is having 0 0 and needing to add a weight to one side or the other. So, if the next digit on the right pan is 0, add your current weight to the right pan. Otherwise, add it to your left pan.
So you'd end up with (orig, left, right):
010 1011 0110 0111
011 0101 1011 0011
011 0101 1011 0011
= 13747

Now where the 16 weight can go, let's look at that part of the sequence: 10 0111 where 16 = 01 0000. The only way we can add the 16 to the right pan is if there is a 1 there already (e.g. 11 0011). But, if we add it to the right, that violates our "look ahead and see 0" rule. So:
a) yes
b) no