Sie sind auf Seite 1von 3

PMATH 330 Mathematical Logic, Solutions to the Midterm

[3] 1: Determine whether the following string X is a formula and, if so, make a derivation for it. X = (((P Q) (R (P Q)) (R S ))) Solution: This is not a formula. The second open bracket is followed by the formula (P Q) which is followed by the binary connective then by the formula (R (P Q)), and this must be followed by the close bracket symbol, but it is followed by the symbol . [3] 2: Convert the following formula F into prex notation. F = ((((P Q) (R S )) (P R)) Q) Solution: In prex notation, this becomes P Q RS P RQ [3] 3: Determine whether the following string X is a list of formulas in prex notation and, if so, convert it to standard notation. X = P QR Q P QS P R. Solution: This is a list of two formulas in prex notation. In standard notation, it becomes (P (Q R)) (Q ((P Q) S )) , (P R) [3] 4: List all of the formulas that can be obtained by inserting brackets into the following string. P Q R Solution: We must insert two pairs of brackets. The inner pair can be placed in the following 5 ways: P (Q R) , P (Q R) , (P Q) R , (P Q) R , (P Q) R For each of these 5 ways, it is not hard to list all the ways of inserting the outer pair of brackets. We obtain the following 12 formulas: (P (Q R)) , (P (Q R)) , (P (Q R)) (P (Q R)) , (P (Q R)) , (P (Q R)) ((P Q) R) , ((P Q) R) , ((P Q) R) ((P Q) R) , ((P Q) R) , ((P Q) R) [3] 5: Let F = ((P Q) R) (Q R) . Determine whether F is a tautology. Solution: We make a truth-table. P Q R P 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 1 (P Q) 1 1 1 1 1 1 0 0 ((P Q) R) R 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 (Q R) F 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1

We see that F is true on every row, so F is a tautology.

[3]

6: Let F = ((P Q) R), G = ((P Q) R) and H = (P (R Q)). Determine whether {F, G, H } is satisable. Solution: We make a truth-table. P Q R 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 (P Q) F 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 0 (P Q) G P 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 1 1 1 (R Q) H 1 1 0 1 1 1 0 1 0 0 0 0 1 1 0 1

We see that there is no row where F , G and H are all true, so {F, G, H } is not satisable. [3] 7: Let F and G be formulas. Make a derivation for the following truth-equivalence. Provide justication at each step. (F G) ((F G) H ) treq F (G H )) Solution: Here is one possible derivation. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. [4] ((F G) ((F G) H )) ((F G) ((F G) H )) ((F G) ((F G) H )) ((F G) (F (G H ))) (F (G (G H ))) (F ((G G) (G H ))) (F ((G H ) (G G))) (F ((G H ) (G G))) (F (G H )) (F (G H )) Implication Implication Associativity Distributivity Distibutivity Commutativity Commutativity Tautology Implication

8: Let F = (P (Q R)), G = (P R) and K = ((P Q) R). Use truth-equivalences to put ((F G) K ) into DNF, and hence determine whether {F, G} | = K. Solution: We have ((F G) K ) = ((P (Q R)) (P R)) ((P Q) R) treq ((P (Q R)) (P R) (R P )) ((P Q) R) treq ((P (Q R)) (P R) (R P )) ((P Q) R) treq ((P (Q R)) (P R) (R P )) (P Q) (R) treq (P (Q R)) (P R) (R P ) (P Q) (R) treq (P (Q R)) (P R) (P Q) (R) treq (P Q) (P R) (P R) (P Q) (R) treq (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) treq (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) (P Q R) Since the DNF formula contains all 8 constituents, we have | = ((F G) K ) and hence {F, G} | = K.

[3]

9: Determine the number of DNF formulas F on {P, Q} such that either F | = P or F | =Q Solution: There are 6. They are the 6 DNF formulas F1 , , F6 with the following truth-table columns. P 1 1 0 0 Q 1 0 1 0 F1 1 1 0 0 F2 1 0 0 0 F3 0 1 0 0 F4 0 0 0 0 F5 1 0 1 0 F6 0 0 1 0

Indeed, in order to have F | = P , the truth-table column for F must have a 0 in rows 3 and 4, so F must be one of the formulas F1 , F2 , F3 , F4 , and in order to have F | = Q, the column for F must have a 0 in rows 2 and 4, so F must be one of F2 , F4 , F5 , F6 . To be explicit, the DNF formulas are F1 = (P Q) (P Q), F2 = (P Q), F3 = (P Q), F4 = , F5 = (P Q) (P Q) and F6 = (P Q). [4] 10: Let and be binary connectives with (F G) treq (F G) and (F G) treq (F G). Determine whether {} is adequate, and determine whether {} is adequate. Explain your answers. Solution: The set {} is adequate since F treq (F F ) treq (F F ) and (F G) treq (F G) treq ((F F ) (G G)), and so the connectives and can both be expressed in terms of (up to truth-equivalence) and we know that {, } is adequate. On the other hand, the set {} is not adequate since every formula which only uses the connective has a 0 in the last row of its truth-table column. Indeed, let be the truth-evaluation with (P ) = 0 for every propositional variable P . Then if F = P where P is a propositional variable then (F ) = (P ) = 0, and if F = (G H ) where G and H are formulas with (G) = (H ) = 0 then we have (F ) = (G H ) = ((G H )) = 0, and so by induction on formulas which only use , we have (F ) = 0 for every such formula F . [4] 11: Apply the DPP to determine whether the following clause set S is satisable and, if so, nd every truthevaluation on {P, Q, R, S } which satises S . S = {P, Q, R}, {P, Q, S }, {P, R, S }, {P, R}, {P, S }, {Q, R, S }, {Q, S } Solution: We resolve on P and clean up to get S1 = {Q, R}, {Q, R, S } , {Q, R, S } , {Q, S }, {Q, R, S }, {Q, S } . Next we resolve on Q to get S2 = {R, S }, {R, S }, {R, S } . Although it is easy to see that this clause set is satisable, the DPP instructs us to resolve on R to get S3 = {S } . This is satisable. Let us nd every truth-evaluation which satises S . From the clause {S } is S3 , we must have (S ) = 1; from the clause {R, S } in S2 we must have (R) = 0; from the clause {Q, S } in S1 we must have (Q) = 0; and from the clause {P, R, S } in S we must have (P ) = 1. Thus the only truth-evaluation which satises S is the one given by the following table P 1 [4] Q 0 R 0 S 1

12: Determine, with proof, whether the following statement is true, for all formulas F , G, H . If (F G) | = H then F | = (G H ) . Solution: The statement is true, and we give a proof. Suppose that (F G) | = H . Let be a truthevaluation. Suppose that (F ) = 1. We must show that (G H ) = 1 . Suppose that (G) = 1. Now we must show that (H ) = 1 . Since (F ) = (G) = 1 we have (F G) = 1. Since (F G) = 1 and (F G) | = H we have (H ) = 1 as required.

Das könnte Ihnen auch gefallen