Monday, January 25, 2010

Base-n arithmetic and wiggle

We saw above that

            5103105;104109 = 535.49.

Being explicit about the base, we can write

            5103105;104109 = 535.4910.

Translating numbers in other bases into wiggle is an immediate generalization.  As a first example, suppose we are trying to evaluate

            101101112.

We rewrite this, with the same digits---or bits---in the same order as the superdigits, and making each interbase be 2, so that



            101101112 = 120212120212121.

Telescoping from left, we get

            1×2 = 2,
            2+0 = 2,
            2×2 = 4,
            4+1 = 5,
            5×2 = 10,
            10+1 = 11,
            11×2 = 22,
            22+0 = 22,
            22×2 = 44,
            44+1 = 45,
            45×2 = 90,
            90+1 = 91,
            91×2 = 182,
            182+1; = 183;

so that in the end

            101101112 = 183.

Let's try one with a fractional part.  What is

            102.213?


Rewriting in wiggle, we have

            102.213 = 13032;3231.

Telescoping from the left and the right, we get

            13032;3231 = (3+0)32;3231,                  = 332;3231,
                 = (9+2);3231,
                 = 11;3231,
                 = 11;3(2+13),
                 = 11;373,
                 = 1179.

Odder bases are also easy to calculate with.

No comments:

Post a Comment