Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a simple way of looking at it (and we'll build up to the matrix notation).

The nth and (n+1)st fibonacci numbers can be written as a system of two equations in the nth and (n-1)st numbers:

  F(n) = F(n)
  F(n+1) = F(n) + F(n-1)
where the base cases are F(0) = 0 and F(1) = 1.

The question is then to show that (note that the indices under F are actually wrong in the OP...):

  1/89 = .01F(2) + .001F(3) + .0001F(4) + ... + 10^(-n)F(n) + ...
One beautiful (and mathematically simple) way of analyzing this system is by the use of linear algebra. The idea is that, because F(n+1) depends linearly on F(n) and F(n-1) (see the above definition), then we can write the previous system with the following (linear-algebraic) notation

  [ F(n)   ] = [ 0 1 ] [ F(n-1) ]
  [ F(n+1) ] = [ 1 1 ] [ F(n)   ].
If we write x(n+1) as the vector (F(n), F(n+1)), i.e., first entry is F(n) and the second entry is F(n+1), and the matrix as A, then x(n+1) = Ax(n). (Note that A is the matrix whose entries are exactly the coefficients of the linear equation we gave above!)

In other words, we've reduced the problem down to the question of investigating the properties of the matrix A ! Now, the sum we were looking at, originally, can be written (in terms of x(n)) as the first entry of (note that x is a vector as we've defined it!)

  x(2) + .1x(3) + .01x(4) + ... = x(2) + .1Ax(2) + .01 A Ax(3) + ... = x(2) + (.1A)x(2) + (.1A)^2 x(3) + ...
There's a slick proof (see [0]) that, if this sequence converges, then its result is given by the first entry of

  (I - .1A)^(-1)x(2),
which is exactly what the result gives. (I have changed the normalization a little bit for convenience, but it is the same proof :)

-----

[0] If

  y + By + B^2y + ... = z converges, then we can multiply both sides by B to get

  By + B^2y + ... = Bz
But, here's the magic! Let's subtract the first equation from the second to get

  y = z - Bz = (I - B)z,
so, multiplying by the inverse of B on both sides, we get:

  y + By + B^2y + ... = z = (I - B)^(-1)y,
as required!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: