British puzzle creator Hubert Phillips invented this genre of puzzle in the 1930s.
I have slightly modified a puzzle attributed to H.P. (a.k.a. Caliban).
One of five people is a murderer.
Here are their statements:
Bernie: Becky didn’t do it.
Benny: Betty did it.
Bella: Becky is innocent.
Betty: Becky did it.
Becky: I did not do it.
Can you identify the killer?
Given k people, including the killer, lied – provide your answers and reasoning for all possible values of k.
Does the statement in the puzzle "Given k people, including the killer, lied", presuppose that there exists at least one person who is lying? Principally, k could be zero ("Nobody lied, including the killer").
That's why the justification in Math Man's statement "Since the killer lied, Bernie did not do it" is maybe questionable. Because the justification for "since the killer lied" is not in that statement of the puzzle (as k could be zero) but follows automatically and trivially from: (a) There is a contradiction about Becky; and (b) there is a contradiction about Becky vs. Betty.
That's why there must be at least one liar and, therefore, why the killer must be among them. A presupposition out of the puzzle text would be unnecessary (as my comment certainly is).
Of course, I agree with the solutions that were given by the solvers before.
/*
 ? solution(Bernie,Benny,Bella,Betty,Becky).
Becky = (1,0),
Bella = (1,0),
Benny = (1,0),
Betty = (0,1),
Bernie = (1,0) ? ;
Becky = (1,0),
Bella = (1,0),
Benny = (0,1),
Betty = (0,0),
Bernie = (1,0) ? ;
Becky = (0,1),
Bella = (0,0),
Benny = (0,0),
Betty = (1,0),
Bernie = (0,0) ? ;
no
*/
s(1). % statement true
s(0). % statement false
k(1). % killer
k(0). % not killer
solution(bernie(S1,K1),benny(S2,K2),bella(S3,K3),
betty(S4,K4),becky(S5,K5)) :
s(S1),s(S2),s(S3),s(S4),s(S5),
k(K1),k(K2),k(K3),k(K4),k(K5),
KillerSum is (K1+K2+K3+K4+K5), % Only one killer
KillerSum is 1,
( (S1=1) => (K5=0) ), % True statements
( (S2=1) => (K4=1) ),
( (S3=1) => (K5=0) ),
( (S4=1) => (K5=1) ),
( (S5=1) => (K5=0) ),
( (S1=0) => \+ (K5=0) ), % False statements
( (S2=0) => \+ (K4=1) ),
( (S3=0) => \+ (K5=0) ),
( (S4=0) => \+ (K5=1) ),
( (S5=0) => \+ (K5=0) ),
TruthSum is (S1+S2+S3+S4+S5),
( (TruthSum < 5) => % (k>0)>(killer=liar)
( (K1=1) => (S1=0) ),
( (K2=1) => (S2=0) ),
( (K3=1) => (S3=0) ),
( (K4=1) => (S4=0) ),
( (K5=1) => (S5=0) )
).

Posted by ollie
on 20161118 19:42:06 