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

Home > Logic
The not-always-lying islanders (Posted on 2021-12-22) Difficulty: 3 of 5
On a remote island, its inhabitants might lie at any given moment. However, they are restricted by the island code NOT to tell 3 lies in a row.
A group of visitors to the island meets an inhabitant of the island.
Responding to various queries of the visitors he made precisely 17 consecutive statements.
How many combinations of truths/lies can there be?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 1 of 4
A true statement can follow any valid sequence of statements, so there is a one-to-one relationship between 'sequences of n statements' and 'sequences of n+1 statements ending with a true statement'.

So then we will find a formula to calculate the number of sequences of statements ending with a true statement.

Let T represent a true statement and L represent a lie
There is 1 sequence of length 1 ending with a true statement: T
There are 2 sequences of length 2 ending with a true statement: TT, LT
There are 4 sequences of length 3 ending with a true statement: TTT, TLT, LTT, LLT.

Longer sequences can be built recursively by adding one true statement, possibly with lies in between, to an existing sequence.  
To make a length N sequence we can append T to a length N-1 sequence, or append LT to a length N-2 sequence, or append LLT to a length N-3 sequence.

Then all this information gives us a recursion: S(N) = S(N-1) + S(N-2) + S(N-3) with S(0)=1, S(1)=2, and S(2)=4.
Indexing this starting at 0 will make S(17) line up with the problem's desired goal of finding  the number of possible truth/lie sequences of 17 consecutive statements made by the inhabitant.
Then S(17) = 35890.

A quick search on OEIS finds this is the Tribonacci Sequence. http://oeis.org/A000073

  Posted by Brian Smith on 2021-12-22 12:50:55
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information