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 re: computer solution | Comment 3 of 4 |
(In reply to computer solution by Charlie)

Changing the line


if lieCt<3

to

if lieCt<2

makes the solution agree with Brian's 35890.

>> for i = 1:25 disp(seqSet(i,:))
 end
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0
  1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0
  1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1
  1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0
  1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1
  1 1 1 1 1 1 1 1 1 1 1 1 0 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 0 0 1 0 0 1 0 0 1 0 1
 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
>>     

  Posted by Charlie on 2021-12-22 13:24:54
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
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