You are on page 1of 5

Introduction to AI Exercises on Propositional Logic

davide.grossi@uni.lu 9-5-2008
1. Italy, 13th April 2008. A journalist stops three friends (Mr. Rossi, Mr. Bianchi and Mr. Verdi) who just left the voting oce. The journalist interviews them separately about their votes in the elections. Mr. Rossi declares: If Bianchi voted for Berlusconi then also Verdi did. Mr. Bianchi declares: If Rossi did not vote for Berlusconi, then also Verdi did not. Finally, Verdi declares: Rossi voted for Berlusconi while Bianchi did not. (a) Are the declarations compatible? (b) If all three voted for Berlusconi, who is lying? (c) If all three voted against Berlusconi, who is lying? (d) If all three are telling the truth, who has voted for Berlusconi and who has voted against him? (e) If all three are lying, who has voted for Berlusconi and who has voted against him? (f) If the ones who voted for Berlusconi are telling the truth, and who has voted against Berlusconi are lying, who has voted for him and who has voted against him? (g) If only one of the three is telling the truth, who is he and how did everybody vote? Use truth-tables! 2. Prove, using truth-tables or tableaux, that: (a) (A (A B)) B is a tautology; (b) B is a logical consequence of A and A B; (c) (A B) (A B) is a contradiction. In solving the exercise recall that: {A1 , . . . , An } is a tautology! 3. Prove that: 1 B i A1 . . . An B

(a) For all propositional formulae in the empty set , any interpretation assigns them value 1; (b) A is a tautology i A.

Solutions 1. Let r, b, v denote Mr Rossi (respectively, Mr. Bianchi, Mr. Verdi) has voted for Berlusconi. The declarations of the three friends can be formalized as follows: Mr. Rossi declares that b v, Mr. Bianchi that v r and Mr. Verdi that b v. To easily answer the questions it suces to build the truth table of (b v) (v r) (b r). r 1 1 1 1 0 0 0 0 b 1 1 0 0 1 1 0 0 v 1 0 1 0 1 0 1 0 bv 1 0 1 1 1 0 1 1 v r 1 0 1 0 1 1 1 1 b r 0 0 0 0 1 1 0 0 (b v) (v r) (b r) 0 0 0 0 1 0 0 0

Answers: (a) The declarations are compatible since (b v) (v r) (b r) is satisable. (b) Mr. Verdi is lying since if r, b, v are simultaneously true (rst row) then Mr. Verdis declaration b r is false. (c) Mr. Verdi is lying again if r, b, v are simultaneously false (last row). (d) If they are all telling the truth (5th row), then Mr. Bianchi and Mr. Verdi voted for Berlusconi and Mr. Rossi against him. (e) If they are all lying (2nd row), then Mr. Rossi and Bianchi voted for and Mr. Verdi against. (f) The situation corresponds to the 4th row. Hence Mr. Rossi voted for, while Mr. Bianchi and Mr. Verdi against. (g) The situation corresponds again to the 4th row. Hence Mr. Rossi voted for, while Mr. Bianchi and Mr. Verdi against. 2. Answers:

(a) Both the truth-table and the tableau are provided: A 1 1 0 0 B 1 0 1 0 AB 1 0 1 1 A (A B) 1 0 0 0 (A (A B)) B 1 1 1 1

True

False (A (A B)) B

(A (A B)) B A AB (i) (ii) B

(i) (ii) A

(b) It follows from the previous point since we know that {A1 , . . . , An } B i A1 . . . An B is a tautology! (c) The answer requires the use of truth-tables: A B 1 1 1 0 0 1 0 0 AB 1 0 0 0 AB 1 1 1 0 (A B) 0 0 0 1 (A B) (A B) 0 0 0 0

Notice that, in this case, we cannot use a tableau. A tableau would only show that the formula is falsiable, and not that it is a contradiction. The tableau could be use by showing that the negation of (A B) (A B) is a tautology, which is equivalent to show that (A B) (A B) is a contradiction. 3. (a) Claim: For all propositional formulae in the empty set , any interpretation assigns them value 1. Proof: Consider an interpretation I. Let us prove that for all formulae in , I assigns them value 1. If this is not the case then there would be a formula B such that I(B) = 0 and B which is impossible since does not contain any element. QED (b) Claim: A is a tautology i Proof: A.

[1st subclaim:] If A is a tautology then A. A is a tautology, hence it is assigned value 1 by any interpretation I. Now, we know from point 3a that any interpretation assigns value 1 to all formulae in . It follows that A. This proves the rst subclaim. [2nd subclaim:] If A then A is a tautology. From A it follows that for any interpretation I, if I assigns value 1 to all formulae in , then it assigns value 1 to A. From point 3a, any interpretation I trivially assigns value 1 to all formulae in (as proven in the proof of [1st subclaim]), hence for all interpretations I, we have that I(A) = 1. This proves the second subclaim and concludes the proof. QED

You might also like