Trond wrote:freak wrote:Note that the whole thing works without any tigers at all. Good for the king in case there is a tiger shortage in the country

Actually, I think the reason my answers are different from yours, is that some of yours are wrong. It's impossible to do without a tiger.
See:
0. Assume we know the princess is in room 7
A. Sign 2 is true if sign 5 is true
B. Sign 2 is false if sign 5 is false
C. The truth value of sign 2 and 5 are equal.
D. Sign 5 is true if sign 6 is true.
E. Sign 5 is false if sign 6 is false.
F. The truth value of sign 5 and 6 are equal.
G. The truth value of sign 2, 5 and 6 are all equal.
H. If the truth value of sign 2 is true, the truth value of sign 6 must be true, but sign 6 can only be true if sign 2 is false. It thus leads that 2, 5 and 6 cannot be true, they must be false.
I. For sign 6 to be false when sign 2 is false, the statement "room 8 is empty" must be false.
J. If the statement "room 8 is empty" is false, something must be in room 8.
K. If the princess is in room 7, she cannot be in room 8.
L. There must be a tiger in room 8.
Yes, i misread the sign 8 when i did my code. If i correct it however, i get no solutions at all. Here is why:
A. If the princess is in room 7, then all other signs must be false.
B. for sign 6 to be false, room 8 may _not_ be empty (as "sign 2 is false" is true)
C. for sign 8 to be false, room 8 _must_ be empty (as "sign 3 is false" is true, and it does not contain the princess)
So either both our logic concerning signs 2, 5 and 6 is wrong, or 7 is not the answer.
Lets start again:
A. If sign 7 is true, the princess must be in room 7.
B. As i showed above, that leads to an impossibility.
C. If sign 7 is false, the princess cannot be in 1, 3, 5, 7, leaving only 2, 4, 6, 8
D. Room 2 is out, because its sign can never become true with a princess in it
E. Room 4 is out, because if there is a princess in it, sign 1 becomes true
F. Room 6 is out, because if she is in room 6, then sign 6 is true, but that also makes sign 5 true
G. Room 8 is out, because if it contains the princess, it cannot contain a tiger
... no more possible rooms left!
Now what?
Maybe the princess is a quantum particle?
