Four young people each made two statements about their ages:
-
Parker: I'm 18 years old. Remy is 15.
-
Quinn: I'm 13. Skyler is 17.
-
Remy: Parker is 16. Quinn is 12.
-
Skyler. Remy is four years younger than Parker.
I'm three years older than Remy.
Only one of the four was a knight and made two true statements. The rest, knaves, alternated telling the truth and lying, though we don't know what phase they were in at the beginning.
What were their correct ages?
From Mensa Puzzle Calendar 2021 by Fraser Simpson, Workman Publishing, New York. Puzzle for November 9.
lord@rabbit 12524 % tru
statements p q r s: TF FT FT TT ages: 18 12 14 17
(Skyler is the knight)
program tru
logical p1,p2,q1,q2,r1,r2,s1,s2,t1,t2,t3,t4
integer p,q,r,s
do p=10,19
do q=10,19
do r=10,19
do s=10,19
p1=(p.eq.18)
p2=(r.eq.15)
q1=(q.eq.13)
q2=(s.eq.17)
r1=(p.eq.16)
r2=(q.eq.12)
s1=(r.eq.p-4)
s2=(s.eq.r+3)
t1=(((p1 .and.p2).and.(q1.neqv.q2)).and.((r1.neqv.r2).and.(s1.neqv.s2)))
t2=(((p1.neqv.p2).and.(q1 .and.q2)).and.((r1.neqv.r2).and.(s1.neqv.s2)))
t3=(((p1.neqv.p2).and.(q1.neqv.q2)).and.((r1 .and.r2).and.(s1.neqv.s2)))
t4=(((p1.neqv.p2).and.(q1.neqv.q2)).and.((r1.neqv.r2).and.(s1 .and.s2)))
if(t1.or.t2.or.t3.or.t4)print 1,p1,p2,q1,q2,r1,r2,s1,s2,p,q,r,s
1 format('statements p q r s: ',4(2l1,x),x,'ages: '4(i2,x))
enddo
enddo
enddo
enddo
end
Edited on December 7, 2021, 3:26 am