This problem is one with which I am already familiar, so I am going to begin with my solution and then spend the majority of time on my thoughts. The weights must be: 1g, 3g, 9g, 27g. With these four (and only these four) you could weight out any integer weight from 1g to 40g. The key observation here is that you can place a weight on either side of the scale, either opposite the herbs or on the same pan as them. This means that you can functionally add or subtract the weight from the total balance you are trying to create.
Rather than list out every method to sum the numbers 1 to 40, I think it is more elegant to demonstrate why these numbers work. In constructing the solution, we can begin by imagining each weight as a distance on a number line that we can reach. For example, the 1g weight can move us 1 step in either direction on a number line, depending on which pan it is on. For maximum efficiency, we want there to be only one way to sum to each number. Otherwise we have an extraneous weight. Thus, each combination of adding a weight, subtracting a weight, or omitting a weight should give us a unique number. What I am functionally describing is a tertiary counting system, base 3.
This requires some imagination, but the analogy is straightforward. Rather than using the digits, 0,1,2, let us imagine using -1,0,1. This does not change the number of unique numbers we can create, only their values. Technically, this method also includes numbers from -40 to 0, but we can disregard them when making our counts. Given that we are working in a tertiary system, we then know the values of each "place." They must be powers of three (e.g. 1,3,9,27). This is not a proof, exactly, but I think it a compelling justification.
An interesting follow-up to this reasoning is asking the question: "what if we couldn't subtract?" For example, what if there was a practical reason that we couldn't place a weight on the same pan as the herbs? Maybe they are loose and would stick to it, for instance, or be contaminated. We can imagine lots of possible reasons. The question is then: "how many weights do we need (and what are they)?"
Happily we can solve using the same logic, only with a binary system rather than a tertiary one. This means our most efficient weights are all powers of two (1,2,4,8,16 in this case). Something that I have used to introduce binary to students is a 'magic trick' I learned from my father. You consider the numbers 1 to 63. On a flash card, write out all the numbers which have a 1 in the 1s place within that range (all the odd numbers). Then, on a new card, write out all the numbers which have a 1 in the 2s place (in binary, that is). Continue this pattern until you have a 1s card, a 2s card, a 4s card, an 8s card, a 16s card, and a 32s card. Then ask a volunteer to pick a number and hand you all the cards which contain that number. You will be able to instantly tell what number they chose by summing the first numbers on every card you are handed. Being handed a card is a 1, not being handed it is a 0. You can use this trick without understanding binary, which is why it is a good intro, but knowing why it works requires the binary understanding. At some point, I would love to develop a tertiary version of the trick.
Beautifully explained and very compelling. I'm sure that you'll be working with these ideas with your classes!
ReplyDelete