Re: Get the Princess!
Posted: Fri Sep 10, 2010 11:15 pm
I read it in swedish and I'm convinced that the princess is in room 7.
http://www.purebasic.com
https://www.purebasic.fr/english/
Given: If a room contains a tiger, it's sign must always be false; if a room contains the princess it's sign must always be truee.Trond wrote:You can logically prove that there must be a tiger in room 3 and 8. Thus your assumption that these rooms are empty can not be right.Logic proceeds this way, if a room's sign contains fluctuating truthness (i patented that term ) then the room must be empty. This applies to the group of rooms {2, 5, 6}, {1, 4}, and {3, 8}.
Code: Select all
s3 = sign #3, s8 = sign #8, c2 = contents of #2, c7 = contents of #7, c8 = contents of #8
sign 3:
A B
If (c2 = #Empty) And (c7 = #Empty)
s3 = #True
Else
s3 = #False
Endif
Condition B is True because the princess is in room #7.
Condition A fluctuates between True ane False.
s3
A B result
-- -- ------
1. T And T TRUE
3. F And T FALSE
s3 fluctuates between True and False which means that room #3 contains nothing.
sign 8:
C D
If (c8 = #Tiger) And (s3 = #False)
s8 = #True
Else
s8 = #False
Endif
If Condition C = #True then s8 = #False and either C or D must be False.
C cannot be False and True at the same time.
D is a fluctuating condition and cannot be False and True all the time.
s8
C D result
-- -- ------
1. F And T FALSE
2. F And F FALSE
3. T And T TRUE
4. T And F TRUE
s8 fluctuates between True and False which means that room #8 contains nothing and results in condition C always being False.blueznl wrote:You're right, my coding for rule 8 is wrong. I will change it and try again. It should be something like:
... but I will check later.Code: Select all
if room(8) <> #tiger or room(3) = #tiger found = #false endif
Code: Select all
if room(8) <> #tiger or room(3) = #tiger
found = #false
endif
No, if a room contains a tiger, its sign must always be false. And the sign of the princess is always true.Given: If a room contains a tiger, it's sign must always be true; if a room contains the princess it's sign must always be false.
That cant be. If sign 2 is false the princess is in room 2, because the sign sais so. But that cant be because the sign of the princess have to be true.Trond wrote:Yes, an unresolvable conflict occurs if sign 2, 5 or 6 is true. So we know all of them must be false. Because we can't have any unresolvable conflicts in our logic.Arctic Fox wrote:If sign 6 is false, and it says that sign 2 is false (which is a false statement), then sign 2 must be true? And then sign 6 must be true, too - I am confusedTrond wrote: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.
As i pointed out: if sign 2 is false the princess must be in room 2 because it sais it's no in this room.RASHAD wrote: So Sign 2 is False and Sign 7 is True
This is sign 2:Thorium wrote:That cant be. If sign 2 is false the princess is in room 2, because the sign sais so. But that cant be because the sign of the princess have to be true.Trond wrote:Yes, an unresolvable conflict occurs if sign 2, 5 or 6 is true. So we know all of them must be false. Because we can't have any unresolvable conflicts in our logic.Arctic Fox wrote:If sign 6 is false, and it says that sign 2 is false (which is a false statement), then sign 2 must be true? And then sign 6 must be true, too - I am confusedTrond wrote: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.
Room 7 is not empty if sign on room 3 is true because sign on room 3 sais that room 7 is not empty. And if it's true there must be a princess in there.RASHAD wrote:The Sign of an empty Room can be True or False but still empty
Sign 7 is True The Princess must be in an odd No. Room (Room 3) but Room 7 still empty
Thats unlogical. So the first part of the sign is false and the second is true? That makes no sense.Trond wrote: If sign 5 is false and the princess is not in room 2, sign 2 will be false, but the princess won't be in there either.
@Thorium: If a sign contains two conditions joined by 'and' it is only true if both conditions are true. See my longwinded proof.Thorium wrote:Thats unlogical. So the first part of the sign is false and the second is true? That makes no sense.Trond wrote: If sign 5 is false and the princess is not in room 2, sign 2 will be false, but the princess won't be in there either.
@Little John: I agree. :roll:Little John wrote:It looks to me that here is some disagreement concerning the truth table of a logical conjunction.