A detective has interviewed four witnesses to a crime. From the stories of the witnesses the detective has concluded that if the butler is telling the truth then so is the cook; the cook and the gardener cannot be be telling the truth, the gardener and the handyman are not both lying; and if the handyman is telling the truth then the cook is lying. For each of the four witnesses, can the detective determine whether that person is telling the truth or lying?

Can some help me to solve this problem using Mathematical Logic? No need to put it into prolog. I spent 6.5 hours so far trying and had to give up.

-Shahabudeen

The handyman is telling the truth, the rest are lying.

The detective could tell which witnesses were lying through instinct, experience, story comparison and knowledge of human behavior, although circumstance (dark light, only getting a glimse of the subject, etc etc) could create a situation where the witness story was wrong and suspect, but they were telling the truth about what they thought they saw so would pass a lie detector test. The detective would have to use his better judgement to come to a determination. I'm sure he'd probably get it right if he was pretty experienced, even if he couldn't prove it. He'd know...

This isn't a mathematical problem. There are 8 people involved. This might be a trick question and I gave the trick answer in the second paragraph. The fact that 4 witnesses are not directly associated with the 4 subjects tipped me off to this.

If they were it would have started off with:
A detective has interviewed four witnesses to a crime, the butler, handyman, gardener and cook.

You cannot assume that these witnesses were the butler, handyman, gardener and cook because the problem doesn't explicitly state that they are. It's either a very poorly worded problem, or the professor is trying to trick you.

-Viz

1.p--->c
2.c exor g
3.g + h
4.h--->!c

So finally we have p,c,h false and g true.
Please correct me if i'm wrong

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.