In the prior post, I played with putting together little boxes that perform actions on numbers coming in – simple actions like adding two – and reported on an experiment with seventh graders to find equivalent boxes. I’m going to put the experiment with seventh graders aside for now, and continue to play with the little boxes myself. At some point, we’ll have to expand the repertory of boxes to include some that can take two separate inputs, but for now we’ll stick to boxes that take a single number as their input, and produce a single number as their output.
Since in this post I intend to string together lots of these boxes, I’m going to change my normal habit of putting one above the other, and instead string them together sideways. In the figure above, the left side (a) and the right side (b) are meant to depict a variation on the very same idea: some number goes in, you first add 2 to it, then add 3, and the resulting number comes out.
In the picture above, I have strung together many boxes, like a train made up of railroad cars. There are enough things going on that it probably isn’t immediately obvious what the overall effect of these actions are on the number coming in. And yet, we can systematically simplify this train – in the sense of using fewer and fewer cars – and yet maintain the overall effect. One key idea here is to look at two adjacent cars and see if we can tell what the net effect of those two adjacent cars is. If we can, we can replace those two cars with a single car that has the same net effect – and do so regardless of what the other cars do. So if we look at cars (b) and (c), we might notice that their net effect is adding 4 (add 6, then take away 2). Or we might look at cars (c) and (d) and notice that their net effect is adding 8. Any of these observations will simplify the whole train (again, in the sense of having fewer cars) and it turns out that it doesn’t matter which of these observations you select – either one will do. If two adjacent cars are both additions, you can simplify. If two adjacent cars are both multiplications, you can simplify. If two adjacent cars are some combination of addition and subtractions, you can simplify. If two adjacent cars are some combination of multiplication and division, you can simplify. If you do all those kinds of simplification, and do them repeatedly, you’d end up with a train where multiplication/division and addition/subtraction alternate, as here:
At this point, it may feel like we’re stuck – that we can reduce the number of cars in the train no further. But this isn’t really the case, it is just that we need other tools than the ones we’ve used so far.
When we have a pair where the first operator adds or subtracts, and the later operator multiplies or divides, we can find an equivalent pair in which the order of the operators is reversed. But the equivalent pair won’t have the same numbers as the original. In the example above, +3 followed by × 6 has the same overall effect as × 6 followed by + 18. Here, the + 18 reflects the insight that the × 6 in the figure on the left didn’t merely operate on the number coming in, but also operated on the 3 that got added to that original number.
If we make this substitution, we get:
and though this doesn’t reduce the size of the train directly, it has the effect of putting multiplications together and addition/subtractions together, thus allowing for further train size reductions:
As before, we can take a pair that starts with an addition or subtraction, and reorder the operators while changing the numbers appropriately so that the two pairs behave in the same way. Here, adding 8 and then dividing by 4 has the same effect as first dividing by 4 and then adding 2.
Performing that substitution gives us the train on the left with cars p, h and r. Combining cars p and h gives us the train on the right: multiply by 3 and then add 2. If we did this right, the train with cars s and r behaves exactly the same on the numbers presented on its input as did the much longer train we started with, the one with cars a-h. (As a quick – but insufficient check – we can try some arbitrary number on the input and see if the same number comes out. Indeed, if we try 6 for the input, the long train gives us 12 coming out of a, 18 coming out of b, 16 coming out of c, 26 coming out of d, 15 coming out of e, 90 coming out of f, 80 coming out of g, and 20 coming out of h. Using 6 as input for our shorter train, we get 18 coming out of s, and 20 coming out of r. Both trains have the same output if 6 is the input. So far, so good.)
The approach sketched above suggests that any train of cars – where the cars add something, subtract something, multiply something or divide something – can be shortened to no more than two cars. Is this really so? Might there be some “gotchas” that our breezy exposition may have overlooked? Are there interesting conclusions that can be drawn from our purported result of always being able to reduce a train to two cars (or less)? We will look at those questions in the next post of this series.