thinking

My Photo
Name:
Location: Mountain View, California, United States

thinking := [life, games, movies, philosophy, math, coding, pizza, &c.]

Saturday, September 22, 2007

0.01234567...

A few years ago I strolled through Surely You're Joking, Mr. Feynman, a great book for any rationality-loving reader. In one particular short story, he spoke of the curious number 1/243 = 0.00411522633744... which has a very nice pattern in its decimal expansion. Mr. Feynman doesn't really go into why this number has such a nice expansion, so I put myself to the task. [By the way, it is an especially good introspective query in math to try to grok what is meant when one asks "why" some theorem is true. Any proof works, but we often feel that some proofs (among all the equally correct) are "more explanatory" than others. How does that work?]

In understanding why this number is so cool, we must account for two facts:
  • its decimals have a nice easy pattern in groups of 3 digits, and
  • they arise from a very "natural" number, 1/3^5.

Let's start off with a cool little

Factoid 1 In any base b (such as base 10), 1/(b-1)^2 = 0.0123456...., where the digits are written base b.

We'll see why this is true in a moment. First, let's figure out how this explains Feynman's number.

Here is one way to decompose our number:




.004
115
226
337
...



.000
111
222
333
...
=
+

.004
004
004
004
...


111 x
.000
001
002
003
...
=
+

.004






We can "explain" the first number, 0.000 001 002 003 ..., as 1/999^2, using factoid 1. This works because we can think of each group of three base-10 digits as a single base-1000 digit, and in base 1000, 1/999^2 = 0.01234...; just what we need!

For the other patterned decimal, 0.004, we can use

Factoid 2 In any base b, for any digit 0≤x<b, x/(b-1) = 0.xxxxxx... = 0.x.

[We'll see why this is true below.] Still thinking in base 1000, we can see that .004 004 004 ... = 4 / 999 using this factoid.

Thus we get a nice pattern whenever we add 111 * (1/999^2) + x / 999, for any integer x. We can rewrite that expression as 1/(9*999) + x/999 = 1/999 * (1/9 + x) = 1/(3^3 * 37) * (1/9 + x), using that 3^3 * 37 is the prime factorization of 999.

The only "unnatural" number in this expression is the 37, and guess what? We can cancel that out nicely by setting x = 4, which is (to me, at least) the only "arbitrary-looking" number in Feynam's number. And that's it!

To restate the findings: we saw that any number of the form 1/999 * (1/9 + x) has a nice pattern, similar to Feynman's number, and that setting x=4 works out to make the fraction simplify nicely -- in this case, to 1/243.

--------------

Now let's justify factoids 1 and 2.

For factoid 2, we just need to show that 1/(b-1) = 0.111111..., since we can then multiply both sides by x to get the final result.

Let S = 0.111... . Then b*S = 1.111....; and we can subtract these two numbers, so the infinite decimal part cancels, to get (b-1)*S = 1, so that S = 1/(b-1). That's it! You might notice this is essentially the standard proof to find the sum of an infinite geometric series (which is one way to think about 0.1111...).

For factoid 1, we can just notice that 0.111.... * 0.111... = 0.111... * (0.1 + 0.01 + 0.001 + ...) =


0.0
1
1
1
1
1
...
+
0.0
0
1
1
1
1
...
+
0.0
0
0
1
1
1
...
+
0.0
0
0
0
1
1
...
+
...






=
0.0
1
2
3
4
5
...

In other words, (0.111...)^2 = 0.012345..., which means that 1/(b-1)^2 = 0.012345..., which is exactly factoid 1. Nice and easy!

-------

By the way, after reading all this, you might start wondering: hey, I thought fractions always turned into simple repeated decimal expansions, right? Yes! They do! So how is that consistent with 0.01234... which looks a lot like a linear pattern, and not a repeating decimal? If you think about it, you can answer that yourself. But that leads to an even more interesting question: given any fraction a/b, what is the size of the repeat in the decimal (or base b) expansion? Sounds like a topic for another post!