Wednesday, February 14, 2007

Subdividing

Let's think about a line with notches. What I have in mind is something like this:



I have placed the middle notch somewhat randomly. If we label the left side as 0, and the right as 1000, the notch would correspond to the number 263:



Now, the labels 0 and 1000 are arbitrary. If I had labeled the left side 0, and the right 1, the middle notch would be 0.263 -- about 25% of the way from left to right.

That notch and its location aren't changing. What's changing is the way we describe it -- the labels are. And in fact, these labels only make sense relative to one another. There is no more information in the numbers 0, 263, 1000 than in the numbers 0, 0.263, 1. They only make sense as a way of describing the relationship of that middle point with respect to the whole.

Imagine that we have a template with 10 slots that we can place over the interval. The slots are labeled 0 to 9. When we place it over our line, we find that our notch is located in slot labeled 2.



OK good, now we zoom into that box, and where is our notch? It's somewhere inside. We apply the template again, and the notch is now in the slot labeled 6:



If we repeat this again, we'll see that the next number is 3, at which point we'll get the digits 2,6,3 as the address of our notch. Here, we stopped at 3 digits, but if this was some kind of number from nature, we could keep applying smaller and smaller templates to get a more and more accurate value for the notch. Perhaps at some point we'd realize that we can't make a template fine enough to improve the accuracy of our estimate. Then we'd be forced to stop.

We could also use a template with just 2 slots. It would look like this:



If we apply the same subdivision technique using this template, we'll find the address of our notch to be 0, 1, 0, 0, 0, 0, 0, 1, 1, 1. The first few steps of this process are shown below:



Just like 263 is the address of the notch when using the template with 10 slots, 0100000111 is the address of the notch when using the template with two slots. If we had labeled the two slots A,B instead of 0,1, we'd get ABAAAAABBB. It's the same notch, except its address is specified using a different rule.

Templates of size 2 are used in computers, because they are simpler: at each step, all you have to do is see whether the number is to the left or right of the middle, which is one decision.

With a template of size 10, we go left-to-right, looking to see if the number is in the slot we're in, and in the process above it took us 3 steps to find the first digit, followed by 7 steps for the second, and 4 steps for the final digit -- a total of 14 steps. With a template of size 2, it took us only 10 steps -- an improvement. Given two ways of doing things, one of which is simpler and faster, we go for that one.

In the post above, I used magic numbers, like 1.41421356... which people call "square root of two", and write as 21/2. The reason for the "..." is that no matter how long you apply the template, you keep getting digits out of it, so we are forced to stop at some point.

How was this number, 21/2, computed? I'd like to demonstrate. We can use the subdivision method to do it. Only of course we'll use subdivision by 2, because it's both simpler and faster. We'll call the number X. What do we know about X? It's definitely greater than 1, because 1*1 = 1. It's definitely less than 2, because 2*2=4, and we want X such that X*X=2. So our interval is between 1 and 2. We pick the middle, 3/2.

3/2 * 3/2 = 9/4, which is more than 2. So X is smaller than 3/2, and the first digit is 0.

Now the interval is narrowed down to 1 to 3/2. The middle is 5/4.
5/4 * 5/4 = 25/16, which turns out to be less than 2. So X is greater than 5/4, and the second digit is 1.

I'm obviously not going to continue by hand -- we have computers for that.But you can probably see how you can get any number of digits out of this process. The first ten bits of information are 0, 1, 1, 0, 1, 0, 1, 0, 0, 0. What do these mean? The same thing as 1.41... -- just an approximate address for the notch, nothing more.

No comments:

Archive