I got a question at university which I cannot solve. We are currently working on RSA encryption and I'm not sure what that has to do with the question. Maybe I miss something. Anyway, here is the question:
Inspector D interviews 3 people, A, B and C. All of them give 2 statements, where 1 statement they say is true and 1 is wrong. The inspector knows that and he also knows that exactly one is guilty. Here are the statements:
A: It wasn't me. B did it.
B: It wasn't me. I know that C did it.
C: It wasn't me. B does not know who did it.
So, since there can be only 1 guilty I just looked at each one.
A: If "It wasn't me" is true then "B did it" is wrong. Then Bs 1st statement must be wrong, so C must be the one. But if Cs first statement is wrong it's second must be right, so we have a contradiction.
Same goes for the other two. Am I missing something?
You can easily do this using a truth table:
Statements
$A$ ... A did it.
$B$ ... B did it.
$C$ ... C did it.
$D$ ... B knows who did it.
The truth table \begin{array}{|c|c|c|c|c|c|c|} \hline A& B & C & D & (\neg A \land \neg B) \lor (A \land B) & (\neg B \land \neg D) \lor (B \land D) & (\neg C \land D) \lor (C \land \neg D) \\ \hline 1& 0 & 0 & 0 & 0 & 1 & 0\\ \hline 1& 0 & 0 & 1 & 0 & 0 & 1\\ \hline 0& 1 & 0 & 0 & 0 & 0 & 0\\ \hline 0& 1 & 0 & 1 & 0 & 1 & 1\\ \hline 0& 0 & 1 & 0 & 1 & 1 & 1\\ \hline 0& 0 & 1 & 1 & 1 & 1 & 0\\ \hline \end{array}
Conclusion
As you can see there is only one line where everything in the result is true (the one before the last). So you know that $C$ did it and $B$ did not know it.
Note
(If you're currently taking the course Discrete Mathematics @ TU Graz, it has nothing to do with RSA and belongs to the next chapter, Logic.)