All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 The not-always-lying politician (Posted on 2004-02-27)
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?

 See The Solution Submitted by Federico Kereki Rating: 4.0000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Fibo again | Comment 2 of 20 |
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.

Edited on February 27, 2004, 10:43 am
 Posted by Ady TZIDON on 2004-02-27 10:22:03

 Search: Search body:
Forums (0)