# Alternative on the Island of Knights and Knaves

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

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".

[more]
Contributed by: Izidor Hafner (December 2012)

Open content licensed under CC BY-NC-SA

## Snapshots

## Details

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

## Permanent Citation