Thursday, September 24, 2026

The market puzzle

The wrong idea

I started the scale problem with a brute force method of just trying whatever. Originally I thought "oh we must need a weight of 1 gram" but then I became fixated on the fact that two subsequent numbers could also give us the ability to measure 1 gram. 

For example: 2g weight + 1g spices = 3g weight   

This led me down a rabbit hole of trying pairs. Spoiler alert! This was not the right solution, but I'll show my initial thoughts anyway because they helped me get to an answer in the end. Let's start with 2,3. If we start with 2, 3 we can get all numbers from 1 to 5, except for 4. So now we need a 4 weight.

1 = -2+3

2 =  2

3 =    3

4 = ...

5 =  2+3

Adding that weight we get

4 =       4

5 =   2+3

6 = 1+2+3

7 =     3+4

8 = 1  +3+4

9 =   2+3+4

10= 1+2+3+4

And now we're stuck again and need an 11g weight. But the maximum value this weight can give us is 2+3+4+11 = 20. Not even close!

I then thought maybe our subsequent weights needs to be higher value, and tried that but it was difficult to know what the smaller weights should be, and the sums I could get seemed random. I thought alright it's time to try a different approach, let's throw out the idea that we can do this without a 1g weight.

A new approach

Starting with a 1g weight I thought what is the next smallest number n that would "fill in all the gaps" between 1 and n+1? Here you might try 2, 3, 4 (and I did!) and find that the answer is 3 which gives:

1 =  1

2 = -1 + 3

3 =      3

4 =  1 + 3

But now we're stuck and need to add a weight that gives us 5 grams. Fortunately, we've started a pattern and so finding which weight comes next is simpler than before. We know we can make up to 4 grams already, so we now need a value n such that n-4=5, i.e. n=9.

5 = -1 - 3 + 9

6 =    - 3 + 9

...

13  =  1 + 3 + 9

And now we're stuck again and need to add a weight that gives us 14 grams. Similar to before we need a value n such that n-13=14, i.e. n=27.

14 = -1 - 3 - 9 + 27

...

40 =  1 + 3 + 9 + 27    Yay!

So our weights are 1, 3, 9, and 27 grams.

What about one pan?

We can use what we've learned to find 5 weights that can sum to 31 grams. Let's start with a 1g weight. Now we want the next smallest number that will fill in the gaps between 1 and n+1. Just as before, we try 2 and 3. Because we now only have one pan, we can't "subtract" digits anymore. So this time we find that 2 works, giving:

1 = 1

2 =   2

3 = 1+2

And now we're stuck again. Since we can't subtract anymore, the next weight we need is 4 grams. Now the maximum we can get with our weights is:

7 = 1+2+4

And now we need an 8 gram weight to give us a maximum of:

15 = 1+2+4+8

So we need a 16 gram weight, giving us a maximum of:

31 = 1+2+4+8+16    Yay!

So our weights in this case are 1, 2, 4, 8, and 16 grams.

Extending these ideas

There are a few interesting topics that could be introduced with this puzzle. It could be a way to connect with combinatorics. For example, the number of choices we have for each weight in the 2 pan puzzle is 3: left pan, right pan, or no pan. This means with 4 weights we have 3^4=81 possibilities. But didn't we say it can measure up to 40? Why are we now getting 81? Well, with the four weights, we can get 40 on the left pan, 40 on the right, and 0 (no weights are used), summing to 81 possibilities. This would be a great exercise for students to try, and then you could ask them why the second problem with just one pan sums to 31? Well here we have only 2 possibilities for each weight: used or not used. With 5 weights that is 2^5=32 possibilities. But didn't we say we can measure up to 31 grams? Why do we now have 32 possibilities? The answer is of course that no weights can be used to measure 0 grams.

It could also be a fun way to introduce geometric sequences. You could ask the students if they notice any patterns in the weight values and what they think the next weight would be? Then see if they could use the combinatorial logic discussed above to determine how many grams this set of weights could measure. This would work for both the two and one pan problems. You could also relate the series of numbers (and the number of choices for the weights in each problem) to different bases. 1, 3, 9, 27, ... can be related to base 3 and 1, 2, 4, 8, ... to binary. Lots of applications!



A flower market in Mexico City




No comments:

Post a Comment

The market puzzle

The wrong idea I started the scale problem with a brute force method of just trying whatever. Originally I thought "oh we must need a w...