There happens to be a politician that might lie at any moment (this isn't unusual) but his conscience bothers him enough (now,

**that** is unusual!) so he won't say two lies in a row.

He said ten consecutive statements.

How many combinations of truths/lies can there be?

ans:144

Sol: Denote by a(n) number of possible statements of length n. Clearly a(n)=a(n-1)+a(n-2),since you can add a" T " after each of n-1 statements or a "T+L" after each of n-2 statements .

So a(1)=2,a(2)=3 a(3)=5 etc... a(10)=144

This is classic fibo shifted by one.

Of course one can solve by evaluating the possible number of combinations for 0,1,...5 lies but that would be a tedious process for ,say, n=1000, while a fibo number can be evaluated without any recursion by a short procedure- number of steps being proportional to log(2) n.

In our case simple addition does it in a jiffy:

2 3 5 8 13 21 34 55 89 144.

ady

*Edited on ***February 27, 2004, 10:43 am**