Reference no: EM133389649
Introduction
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 Todd are guilty."
- Steve says, "Both Quinn and Ray are guilty."
- Todd 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. program that computes and prints a solution to this problem, indicating the guilt or innocence of each of the five suspects. For example, if Quinn and Steve are the culprits, the program should print the following to a file: Paul is innocent. Quinn is guilty. Ray is innocent. Steve is guilty. Todd is innocent. 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 straight-forward to modify the program to solve the problem for a different set of statements from the suspects. Include your solution in the analysis
2. 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 1. (For extra credit, accept as input a list of the number and names of which suspects' statements are to be used, e.g.,4 Paul Ray Steve Todd.) Based on the output from this modified program, determine which if any suspects are definitely guilty, which if any are definitely innocent, and which are undetermined.