Alternative on the Island of Knights and Knaves

An alternative is a person who alternatively tells the truth and a lie. That is, if his statement is true, his next statement is false. Once an alternative visited an island in which each inhabitant is either a "knight" or a "knave".
In this problem there are inhabitants, denoted by A, B, C, … . The alternative makes statements, and the problem is to infer who is a knight and who is a knave.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The algorithm makes random statements about inhabitants and checks that the solution is unique. If after 50 attempts it fails, a message is returned.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.