All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
Five sentences (Posted on 2022-02-09) Difficulty: 3 of 5
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?

No Solution Yet Submitted by Math Man    
Rating: 5.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution the computer method Comment 3 of 3 |
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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information