Several crocodiles, dragons and snakes were left on an island. Animals were eating each other according to the following rules. Every day at the breakfast, each snake ate one dragon; at the lunch, each dragon ate one crocodile; and at the dinner, each crocodile ate one snake. On the Saturday after the dinner, only one crocodile and no snakes and dragons remained on the island. How many crocodiles, dragons and snakes were there on the Monday in the same week before the breakfast?

This is an exercise in linear algebra.

This matrix equation inverts one day's meal's:

[1 0 0] [1 1 0] [1 0 0] [1] [C]

[0 1 1]*[0 1 0]*[0 1 0]*[0]=[D]

[0 0 1] [0 0 1] [1 0 1] [0] [S]

Simplifying the matrices:

[1 1 0] [1] [C] [1]

[1 1 1]*[0]=[D]=[1]

[1 0 1] [0] [S] [1]

Now this represents one day to get six days just raise the matrix to the sixth power:

[1 1 0]^6 [1] [C] [65]

[1 1 1] *[0]=[D]=[86]

[1 0 1] [0] [S] [49]

Now the answers can be read off: there were originally 65 crocodiles, 86 dragons and 49 snakes.

Larry used a dumb program and idly commented on the apparent exponential growth rate of 2.32. Using linear algebra I can explicitly derive that value. The eigenvalues of the matrix are 2.32472, 0.33764+/-0.56228*i. The pair of complex values have an absolute value less than 1, so the one real eigenvalue dominates larger powers of the matrix.