**From New Scientist #1673, 15th July 1989** [link]

As I made my way through the jungle with my truthful guide Lamoura, we came upon a clearing, at the centre of which was a large stone. On the stone were carved the following four sentences:

(A) B is true today and C and D are false today, and D is moon.

(B) An even number of A, B, C, D are false today or C is moon.

(C) B is true today and A and D are false today, and B is moon.

(D) B is true today and A and C are false today, and A is moon.

Lamoura explained that beginning on the morrow and running for the next few days was the festival of the Green Moon. So we decided to camp there until the festival was over.

Lamoura told me that on each day of the festival, each of the four sentences is true or false; she also explained that to say that a sentence is moon means that on at least one day of the festival the sentence is true and on at lease one day it is false.

As each day of the festival dawned, a local native gave me a piece of paper stating which sentences were true that day and which were false. I kept these papers and at the end of the festival, I was able to check that what was written on them agreed with what Lamoura had told me. I also noticed that no two papers said the same thing.

How many days did the festival last, which sentence or sentences were true every day, which were false every day, and which were moon?

[enigma521]

### Like this:

Like Loading...

Each day the setter is given a piece of paper detailing which statement is true and which is false (they are all either true or false on each day), so each day the piece of paper consists of a 4 values chosen from “true” and “false”. So there are only 2^4 = 16 possible different slips of paper.

This Python program considers possible “moon” values for each of the statements, and given these values select possible daily truth values for the statements.

Once the daily values have been collected we select some sequence of at least 2 of the values to represent the pieces of paper for each day. We can then verify that the initial “moon” values hold.

It runs in 88ms.

Run:[ @repl.it ]Solution:The festival lasted 2 days. B was true each day. C was false each day. A and D were moon.On one of the days the statements have the values:

On the other day the statements have the values:

And we can verify that A and D are moon, B is always true and C is always false, as required.