1. Sentence 2 is true.
2. An odd number of prime-numbered sentences are true.
3. A prime number of these sentences are true.
4. Sentence 1 is true.
5. A prime number of these sentences are false.
Which sentences are true and which sentences are false?
for a=[false true]
s(1)=a;
for b=[false true]
s(2)=b;
for c=[false true]
s(3)=c;
for d=[false true]
s(4)=d;
for e=[false true]
s(5)=e;
t=sum(s);
primeTrue=sum([s(2) s(3) s(5)]);
good=true;
if s(1)~=s(2)
good=false;
end
if (mod(primeTrue,2)==1) ~= s(2)
good=false;
end
if isprime(t) ~= s(3)
good=false;
end
if s(4) ~= s(1)
good=false;
end
if isprime(5-t) ~= s(5)
good=false;
end
if good
disp(s)
end
end
end
end
end
end
finds
0 0 1 0 1
meaning that only sentences 3 and 5 are true.
|
Posted by Charlie
on 2022-02-09 09:52:29 |