12.07.2015 Views

WUCT121 Discrete Mathematics Logic Tutorial Exercises Solutions

WUCT121 Discrete Mathematics Logic Tutorial Exercises Solutions

WUCT121 Discrete Mathematics Logic Tutorial Exercises Solutions

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>WUCT121</strong><strong>Discrete</strong> <strong>Mathematics</strong><strong>Logic</strong><strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong>1. <strong>Logic</strong>2. Predicate <strong>Logic</strong>3. Proofs4. Set Theory5. Relations and Functions<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 1


Section 1: <strong>Logic</strong>Question1(i) If x = 3 , then x < 2 .(a) Statement(b) False(c) x = 3 ⇒ x < 2(ii) If x = 0 or x = 1, then x = x(a) Statement(b) True(c)( x = 0 ∨ x = 1) ⇒ x = x(iii) There exists a natural number x for which(a) Statement(b) False(iv) If(a)(b)22x ∈and x > 0 , then if x > 1 then x > 1..StatementTrue(c) ( x ∈∧ x > 0) ⇒ ( x > 1⇒x > 1).2x = −2x.(v) xy = 5 implies that either x = 1 and y = 5 or x = 5 and y = 1.(a) Statement(b) False. Consider x = −1and y = −5or x = −5and y = −1.(c) xy = 5 ⇒ (( x = 1 ∧ y = 5) ∨ ( x = 5 ∧ y = 1))(vi) xy = 0 implies x = 0 or y = 0 .(vii)(a) Statement(b) True(c) xy = 0 ⇒ x = 0 ∨ y = 0xy = yx .(a) Statement(b) True(viii) There is a unique even prime number.(a) Statement(b) True, x = 2.<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 2


Question2(a) If x is odd and y is odd then x + y is even.p: x is odd. q: y is odd. r: x + y is even.Form: p ∧ q ⇒ r .(b)(c)(d)It is not both raining and hot.p: It is raining. q: It is hot~ p ∧ q , alternatively ~ p ∨ ~ qForm: ( )It is neither raining nor hot.p: It is raining. q: It is hotForm: p ~ q~ ∧ , alternatively ( p ∨ q)It is raining but it is hot.p: It is raining. q: It is hot.Form: p ∧ q .~ .(e) −1 ≤ x ≤ 2 .p : −1< x,q : −1= x,r : x < 2, s : x = 2 .Form: ( p ∨ q)∧ ( r ∨ s).Question3 :(a) P ∨ Q : <strong>Mathematics</strong> is easy or I do not need to study.(b)(c)(d)(e)(f)(g)P ∧ Q : <strong>Mathematics</strong> is easy and I do not need to study~ Q : I need to study.~ ~ Q : I do not need to study.~ P : <strong>Mathematics</strong> is not easy.~ P ∧ Q : <strong>Mathematics</strong> is not easy and I do not need to study.P ⇒ Q : If <strong>Mathematics</strong> is easy, then I do not need to studyQuestion4(a) The truth tables for ( ~ p ∨ q) ∧ q and ( p ∧ q) ∨ q~ .p q (~p ∨ q) ∧ q (~p ∧ q) ∨ qT T F T T F F TT F F F F F F FF T T T T T T TF F T T F T F FStep: 1 2 3* 1 2 3*The tables are the same(b) The truth tables for ( ~ p ∨ q) ∧ p and ( p ∧ q) ∨ p~ .p q (~p ∨ q) ∧ p (~p ∧ q) ∨ pT T F T T F F TT F F F F F F TF T T T F T T TF F T T F T F FStep: 1 2 3* 1 2 3*The tables are not the same. The student’s guess is false<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 3


Question5(a) The truth tables for(b)p ∨ ~ p and p ∧ ~ p .p p ∨ ~p p ∧ ~pT T F F TF T T F F2* 1 2* 1p ∨ ~ p is a tautology i.e. always true; p ∧ ~ p is a contradiction, i.e. always false(c) Use truth tables.p q (p ∨ ~p) ∨ q (p ∧ ~p) ∧ qT T T F T F F FT F T F T F F FF T T T T F T FF F T T T F T FStep: 2 1 3* 2 1 3*Notice that “true ∨ anything” is true and “false ∧ anything” is falseConclusion: If you have a compound statement R of the form “ T ∨ P ”, where Tstands for a tautology (and P is any compound statement), then R is also atautology. Similarly, if you have a compound statement, S, of the form “ F ∧ P ”,where F stands for a contradiction, then S is also a contradiction.Question6(a) The truth tables for the statements ( p p) ∧ ( q ∨ r)∨ ~ and q ∨ r .p q r (p ∨ ~p) ∧ (q ∨ r) q ∨ rT T T T F T T TT T F T F T T TT F T T F T T TT F F T F F F FF T T T T T T TF T F T T T T TF F T T T T T TF F F T T F F FStep: 2 1 4* 3 1*Notice that the two statements are logically equivalent.In fact, the truth value of the first is dependent entirely on the second<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 4


(b) The truth tables for the statements ( p p) ∨ ( q ∧ r)∧ ~ and q ∧ r .p q r (p ∧ ~p) ∨ (q ∧ r) q ∧ rT T T F F T T TT T F F F F F FT F T F F F F FT F F F F F F FF T T F T T T TF T F F T F F FF F T F T F F FF F F F T F F FStep: 2 1 4* 3 1*Notice that the two statements are logically equivalent.In fact, the truth value of the first is again dependent entirely on the second.Conclusion: If you have a compound statement R of the form “ T ∧ P ”, where T standsfor a tautology (and P is any compound statement), then the truth-value of R dependsentirely on the truth-value of P. Similarly, if you have a compound statement, S, ofthe form “ F ∨ P ”, where F stands for a contradiction, then the truth-value of Sdepends entirely on the truth-value of P.Question7(a) ( p ⇒ q) ∨ ( p ⇒ ~ q)(p ⇒ q) ∨ (p ⇒ ~ q)Step 1 4* 3 2Place F under main connectiveF⇒ must be F F F1 st ⇒ , p must be T and q must be F. T F T F2 nd ⇒ , p must be T and ~q must be Fq must be TTp ⇒ q ∨ p ⇒ ~ q can only ever be true and is a tautologyq cannot be both T and F , thus ( ) ( )(b) ~ ( p ⇒ q) ∨ ( q ⇒ p)~( p ⇒ q) ∨ (q ⇒ p)Step 2 1 4* 3Place F under main connectiveF~must be F and ⇒ must be F F F1 st ⇒ must be T. 2 nd ⇒ , q must be TT T Fand p must be F1 st ⇒ p can be F and q can be T,FTno conflictThere is no contradiction, thus the statement is not a tautology<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 5


(c) ( p ∧ q) ⇒ ( ~ r ∨ ( p ⇒ q))(p ∧ q) ⇒ (~r ∨ (p ⇒ q)Step 1 5* 2 4 3Place F under main connectiveF∧ must be T and ∨ must be F T F∧ p must be T and q must be T∨ ~r must be F and ⇒ must be FT T F F⇒ p must be T and q must be F T Fq cannot be both T and F , thus ( p q) ⇒ ( r ∨ ( p ⇒ q))tautologyQuestion8∧ ~ can only ever be true and is a(a)( )ity(b)p ∧ q ⇒ r ≡~( p ∧ q)∨ rp ⇒≡ (~ p∨~ q)∨ r≡~p∨~ q ∨ r( p ∨ q)≡~p ∨ p ∨ q≡ T ∨ q≡ T≡~p ∨ ( p ∨ q)Implication LawDe Morgan's LawAssociativImplication LawAssociativityNegation LawDominance LawQuestion9(a)LHS = ~(b)LHS =( p ⇒ q)≡~ (~ p ∨ q)≡~~p∧~ q≡ p ∧ ~ q= RHS≡~( p ∧ ~ q)( p ∧ ~ q)≡ (~ p∨~~ q)∨ r≡ (~ p ∨ q)∨ r≡~p ∨ ( q ∨ r)≡ p ⇒= RHS⇒ r( q ∨ r)∨ rImplication LawDe Morgan'sDouble NegationImplication LawDe Morgan'sDouble NegationAssociativityImplication<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 6


Question10(a) If x is a positive integer and x2 ≤ 3 then x = 1 .The proposition is True.2If x is a positive integer, then x ≤ 3 ⇒ x ≤ 3 .Now 3 ≈ 1. 7 and so x = 1.(b) ( ~ ( x > 1) ∨ ~ ( y ≤ 0)) ⇔ ~ (( x ≤ 1) ∧ ( y > 0)).The proposition is false. (You should have tried proving it using De Morgan’s Laws andfailed.)Now find values of x and y that make the statement false.Let x = 0 and y = 1.~ x > 1 ∨ ~ y ≤ 0 is True( ) ( )( x ≤ 1) ∧ ( y > 0)Thus, ~ (( x ≤ 1) ∧ ( y > 0))is also Trueand the proposition is False.is FalseQuestion11(a)~ ( x > 1) ⇒ ~ ( y ≤ 0)≡~ (~ ( x > 1)) ∨ ~ ( y ≤ 0)≡ ( x > 1) ∨ ~ ( y ≤ 0)≡ ( x > 1) ∨ ( y > 0)Implication LawDouble NegationNegation of ≤(b)( y ≤ 0 ) ⇒ ( x > 1 )≡~( y ≤ 0) ∨ ( x > 1)Implication≡ ( y > 0) ∨ ( x > 1) Negation of ≤Law .Question12~ ( ~ ( p ∨ q ) ∧ ~ q )≡~~( p ∨ q)∨ ~~ q≡ ( p ∨ q)∨ q≡ p ∨ q ∨ q≡ p ∨ qDe Morgan'sDouble NegationAssociativityIdempotent Law<strong>WUCT121</strong> <strong>Logic</strong> <strong>Tutorial</strong> <strong>Exercises</strong> <strong>Solutions</strong> 7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!