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

If you diagonalize the matrix in the problem, the formula pops out pretty quickly.


Nice catch, is that from Knuth's book?


Diagonalization is a fairly standard mathematical trick for doing matrix powers easily. If X is some matrix that can be diagonalised as

  X = P^(-1) D P
then

  X^n = (P^(-1) D P)^n = P^(-1) D^n P




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

Search: