Smith, Jones, and Robinson make
four statements each as follows:
Smith:
1. Jones owes me $10.
2. Robinson owes me $5.
3. All Robinson’s statements are true.
4. All Jones’s statements are untrue.
Jones:
1. I owe no money to Smith.
2. Robinson owes me $7.
3. I am British.
4. All Smith’s statements are untrue.
Robinson:
1. I owe no money to anybody.
2. Jones is a Dutchman.
3. I always tell the truth.
4. Two of Jones’s statements are
true, and two are false.
One person made 4 true statements. Who?
Find, for all of them,
which statements are true and which
are false.
clc,clearvars
for s = 0:15
st=dec2bin(s,4);
st=st=='1';
for j=0:15
jt=dec2bin(j,4);
jt=jt=='1';
for r=0:15
rt=dec2bin(r,4);
rt=rt=='1';
good=true;
if st(1) && jt(1) || ...
st(2) && rt(1) || ...
st(3) ~= all(rt) || ...
st(4) == all(~jt)
good=false;
end
if jt(2) && rt(1) || ...
jt(3) && rt(2) || ...
jt(4) ~= all(~st)
good=false;
end
if rt(3) ~= all(rt) || ...
rt(4) ~= sum(jt)==2
good=false;
end
if good
if all(st) || all(jt) || all(rt)
fprintf('%d%d%d%d %d%d%d%d %d%d%d%d \n',st,jt,rt)
end
end
end
end
end
reports
0010 0000 1111
0011 1000 1111
1010 0000 1111
indicating all 4 of Robinson's statements are true.
In the first and last scenarios, all of Jones' statements are false. In the first case Jones owes an amount other than $10 to Smith; in the last case the amount is indeed $10. Robinson definitely does not owe Smith $5, or in fact anything to anybody.
Smith's third statement is definitely true and his fourth statement may or may not be true depending on whether Jones owes some money (other than $10) to Smith.
|
Posted by Charlie
on 2025-02-01 12:26:14 |