Alex, Bert, and Carl know a specific number 1 to 9. From the statements below can you determine the number knowing one of them made three true statements and one of them made three false statements?
Alex: The number is less than or equal to 5.
Bert: The number is 2, 4, 7, or 9.
Carl: The number is even.
Alex: Bert's first statement is false.
Carl: The number is at least 5.
Bert: The number is odd.
Carl: Alex's first statement is true.
Alex: The number is not 1, 2, 8, nor 9.
Bert: Carl made exactly one true statement.
Number true, by person, per possible number:
N A B C
1 2 2 1
2 1 1 2
3 3 2 1
4 2 1 2
5 3 1 2
6 2 0 2
7 1 3 1
8 1 0 2
9 0 3 1
CLS
FOR n = 1 TO 9
a = 0: b = 0: c = 0
IF n <= 5 THEN a = a + 1: c = c + 1
IF n = 2 OR n = 4 OR n = 7 OR n = 9 THEN b = b + 1: ELSE a = a + 1
IF n MOD 2 = 0 THEN c = c + 1: ELSE b = b + 1
IF n >= 5 THEN c = c + 1
IF n <> 1 AND n <> 2 AND n <> 8 AND n <> 9 THEN a = a + 1
IF c = 1 THEN b = b + 1
IF (a = 3 OR b = 3 OR c = 3) AND (a = 0 OR b = 0 OR c = 0) THEN
COLOR 14
ELSE
COLOR 7
END IF
PRINT n, a; b; c
COLOR 7
NEXT
|
Posted by Charlie
on 2007-03-16 08:31:26 |