Question
Can be written in C++, Prolog, Python or Java: You are a detective investigating a robbery, with five suspects having made the following statements: Paul
Can be written in C++, Prolog, Python or Java:
You are a detective investigating a robbery, with five suspects having made the following statements:
Paul says, Ray is guilty. Quinn says, If Steve is guilty, then so is Ray. Ray says, Both Steve and Ted are guilty. Steve says, Both Quinn and Ray are guilty. Ted says, At least one of Paul or Ray is guilty.
You do not know which, nor even how many, of the five suspects were involved in the crime. However, you do know that every guilty suspect is lying, and every innocent suspect is telling the truth. Which suspect or suspects committed the crime?
Assignment 1. Write a program that computes and prints a solution to this problem, indicating the guilt or innocence of each of the five suspects.
The program should not require any input; the logical structure of the suspects statements may be hard-coded into the program source, but in such a way that it would be straightforward to modify the program to solve the problem for a different set of statements from the suspects. Suppose that, during questioning, Quinn declines to make a statement, so that you only have the above statements from the other four suspects. Given just these four statements, what can you conclude?
Write a second program (modified from Problem 1), to print a list of the valid solutions to this problem, with each solution in the same output format as in Problem
This can be written in C++, Prolog, Python or Java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started