In this series, we’ve been looking at a model for presenting and analyzing operators with an intention for it to have applications for students learning math in school. In recent posts, we’ve looked for interesting aspects of school math that aren’t usually thought of as involving operators.
In this post, I’d like to take another look at counting. Counting was discussed earlier in this post. We saw that counting means different things at different degrees of sophistication, starting with producing a sequence of counting numbers “one, two, three” like a song similar to “a, b, c, d, e, f, g” to the melody of “Twinkle, twinkle, little star”. For the purposes of this post, I’m interested in counting as the process by which we obtain the number of blocks in a pile of (identical) blocks. Even more specifically, I’m going to be looking at counting a set of objects that are fixed in place and arranged linearly, as shown below:
Several stages of the counting process are shown, one below the other. Each row shows the group of green blocks to be counted. How far the green blocks extend towards the right we don’t know, because our view of them is blocked, for the moment, in our current position. To visualize the process of counting, we imagine the progress being marked by a separator (the dotted vertical line) that we gradually move from left to right. As the separator moves from the left of a block to the right of that block, the count (shown on the left of each row) is increased by one.
A key idea associated with counting is this separation of the whole pile into two groups: the group of stuff that has already been counted, and the group of stuff that is yet to be counted. A key operation associated with counting is the moving of the separator, which has the effect of moving one of the blocks from the group of yet to be counted into the group of stuff that that has been counted. This move, repeated until the pile of uncounted stuff is empty, is associated with the increase of the number. Normally, it is the speaking of the increasing numbers that we call counting – yet unless the speaking of the increasing numbers occurs in lockstep with the action of moving the separator over, we would arrive at a meaningless number.
The same “moving over the separator” operation shows up in a related scenario, but one where the total count is already known. Imagine a group of 15 students giving one-minute presentations one at a time. At any moment during this affair, there is a group of students who haven’t yet given their presentations, a group of students who has, and at most one student who is in the middle of giving the presentation. If we took snapshots right after a student completed a presentation, the series of snapshots might resemble the picture above quite closely. Here is a representation of it:
Here, the students who have completed their presentation are on the left, those who haven’t yet are on the right, and the separator marks the split between the two groups. As the student on the right of the split finishes the presentation the separator moves over one place. Unlike the counting example, here we already know the total, we know how many students are going to be giving the presentation. Here we can keep track of two numbers, the number of students on the left who have done their presentation, and the number of students on the right who haven’t. As each presentation finishes, the separator moves to the right, the number on the left increases and the number on the right decreases, all in lockstep.
I think it is interesting to show an operator that matches this movement of the separator. Above on the left, I’ve indicated how such an operator might be drawn – you see it has two inputs and two outputs. If you don’t like multiple outputs, you may prefer the version on the right, which has a single object as its output, an object we might call a “split”. If 2|13 is a split of 15, then “moving the separator” produces a different split of 15, namely 3|12.
You may have wondered why we wouldn’t just do the following:
and the short answer to that would be: yes, we could. But the longer answer is more interesting, I think. One of the most interesting things about moving the separator is that it really is just a single action: in one single movement, one of the sides gets bigger and the other side gets smaller by the same amount. There are many, many real-life situations where this issue is critical. I already discussed some of this in a post about transactions: no industrial-strength database could function without it. When you get money from an ATM, you would not accept your account being dinged for the $100 you withdraw without actually getting the cash in your hands, and the bank would hate to give you the $100 in cash without also decreasing the balance in your account. For you, as well as for the bank, the two sides of the exchange must happen as one, even if a power failure hits the bank at the worst possible moment.
And yet, in many ways the combination of the “add 1″ and the “subtract 1″ operators does in fact produce the same result as the “move the split by one” operator – they are almost equivalent. Basically, we should take seriously the box drawn in dotted lines above, and give it a serious job. The job we want it do is to guarantee that what’s happening inside of it happens as a single whole, indivisibly. How it does this, we don’t care, but we don’t ever want to see the addition done without the corresponding subtraction being finished also, nor do we want to see the subtraction done without the corresponding addition being finished also. It is possible to think of this issue in terms of synchronization; and it is worth noting that so far in this series we’ve been ignoring pretty much all issues of time, speed, delay and synchronization in connecting inputs to outputs.