For a two pan scale, the weights you can use are 1g, 3g, 9g, 27g. Essentially, we can formulate the equation like this:
weight_wanted = a(1) + b(3) + c(9) + d(27)
where:
weight_wanted ∈ {1, 2, ... , 40}
a, b, c, d ∈ {-1, 0, 1}
TLDR: -1 = putting the weight on the left side of the scale, 0 = leaving the weight out, 1 = putting the weight on the right side of the scale, and every integer weight between one and forty can be made from some combination using these four weights.
For a one pan scale, the weights you can use are 1g, 2g, 4g, 8g, 16g. Essentially, we can formulate the equation like this:
weight_wanted = a(1) + b(2) + c(4) + d(8) + e(16)
where:
weight_wanted ∈ {1, 2, ... , 31}
a, b, c, d, e ∈ {0, 1}
TLDR: 0 = leaving the weight out, 1 = putting the weight on the scale, and every integer weight between one and thirty-one can be expressed from some combination of these five weights.
A good extension for this problem would be finding the pattern. Say the two-pan problem's parameter weight_wanted becomes bigger. Students might notice that "hey, the weights are three times the previous weight", so the most logical weight to add next would be eighty-one. Students would need to explain why. I think this is a decent activity for Foundation Math 10, since one of the curricular competencies is pattern matching.
The one pan problem is somewhat related to binary numbers? That problem is essentially just flipping bits in a way? Could be an interesting activity to do before introducing binary numbers in computer science classes or math classes!