Upcoming SlideShare
×

# Discrete-Chapter 04 Logic Part II

314 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
314
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
16
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Discrete-Chapter 04 Logic Part II

1. 1. Logic - 04 CSC1001 Discrete Mathematics 11 2 Propositional Equivalences1. Logical Equivalences Definition 1 A compound proposition that is always true, no matter what the truth values of the propositional variables that occur in it, is called a tautology. A compound proposition that is always false is called a contradiction. A compound proposition that is neither a tautology nor a contradiction is called a contingency. Definition 2 The compound propositions p and q are called logically equivalent if p ↔ q is a tautology (that p and q have the same truth values in all possible cases). The notation p ≡ q denotes that p and q are logically equivalent.Example 1 (5 points) Show that ¬ (p ∨ q) and ¬ p ∧ ¬ q are logically equivalent by using truth tables. p qExample 2 (5 points) Show that p → q and ¬ p ∨ q are logically equivalent by using truth tables. p qExample 3 (5 points) Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent using truth tables. p q rมหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
2. 2. 12 CSC1001 Discrete Mathematics 04 - LogicExample 4 (5 points) Show that p ↔ q ≡ (p ∧ q) ∨ ( ¬ p ∧ ¬ q) by using truth tables. p qExample 5 (5 points) Show that (p → q) ∧ (p → r) ≡ p → (q ∧ r) by using truth tables. p q rExample 6 (5 points) Show that (p → q) ∨ (p → r) ≡ p → (q ∨ r) by using truth tables. p q r2. Laws of Logical Equivalences Equivalence Name / Laws p ∧ T≡p Identity laws p ∨ F≡p p ∨ T≡T Domination laws p ∧ F≡F p ∨ p≡p Idempotent laws p ∧ p≡pมหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
3. 3. Logic - 04 CSC1001 Discrete Mathematics 13 Equivalence Name / Laws ¬ ( ¬ p) ≡ p Double negation law p∨q≡q∨p Commutative laws p∧q≡q∧p (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Associative laws (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive laws p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) ¬ (p ∧ q) ≡ ¬ p ∨ ¬ q De Morgan’s laws ¬ (p ∨ q) ≡ ¬ p ∧ ¬ q p ∨ (p ∧ q) ≡ p Absorption laws p ∧ (p ∨ q) ≡ p p ∨ ¬p ≡ T Negation laws p ∧ ¬p ≡ F p → q ≡ ¬p ∨ q Conditional statements p ↔ q ≡ (p → q) ∧ (q → p) Biconditional statementsExample 7 (5 points) Show that ¬ (p → q) and p ∧ ¬q are logically equivalent by using laws of logicalequivalencesExample 8 (5 points) Show that ¬ (p ∨ ( ¬ p ∧ q)) and ¬p ∧ ¬q are logically equivalent by using laws oflogical equivalencesมหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
4. 4. 14 CSC1001 Discrete Mathematics 04 - LogicExample 9 (5 points) Show that p → q ≡ ¬q → ¬p are logically equivalent by using laws of logicalequivalencesExample 10 (5 points) Show that p ∨ q ≡ ¬p → q are logically equivalent by using laws of logicalequivalencesExample 11 (5 points) Show that p ∧ q ≡ ¬ (p → ¬ q) are logically equivalent by using laws of logicalequivalencesExample 12 (5 points) Show that ¬ (p → q) ≡ p ∧ ¬q are logically equivalent by using laws of logicalequivalencesมหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
5. 5. Logic - 04 CSC1001 Discrete Mathematics 15Example 13 (5 points) Show that (p → q) ∧ (p → r) ≡ p → (q ∧ r) are logically equivalent by using laws oflogical equivalencesExample 14 (5 points) Show that (p → r) ∨ (q → r) ≡ (p ∧ q) → r are logically equivalent by using laws oflogical equivalencesExample 15 (5 points) Show that p ↔ q ≡ ¬p ↔ ¬q are logically equivalent by using laws of logicalequivalencesExample 16 (5 points) Show that p ↔ q ≡ (p ∧ q) ∨ ( ¬ p ∧ ¬ q) are logically equivalent by using laws oflogical equivalencesมหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
6. 6. 16 CSC1001 Discrete Mathematics 04 - LogicExample 17 (5 points) Show that ¬ (p ↔ q) ≡ p ↔ ¬q are logically equivalent by using laws of logicalequivalencesExample 18 (5 points) Show that (p ∧ q) → (p ∨ q) is a tautology by using laws of logical equivalencesExample 19 (5 points) Show that (p → q) ∧ (q → r) → (p → r) is a tautology by using laws of logicalequivalences 3 Predicates and Quantifiers1. Predicates Definition 1 Predicates are the statements that involving variables, for example “x = y + 3,” “computer x is under attack”Example 1 (2 points) Let P(x) denote the statement “x > 3” What are the truth values of P(4) and P(2)?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
7. 7. Logic - 04 CSC1001 Discrete Mathematics 17Example 2 (2 points) Let A(x) denote the statement “Computer x is under attack by an intruder.” Suppose thatof the computers on campus, only CS2 and MATH1 are currently under attack by intruders. What are truthvalues of A(CS1), A(CS2), and A(MATH1)?Example 3 (2 points) Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the propo-sitions Q(1, 2) and Q(3, 0)?2. Quantifiers Definition 2 The universal quantification of P(x) is the statement “P(x) for all values of x in the domain.” The notation ∀ xP(x) denotes the universal quantification of P(x). Here ∀ is called the universal quantifier. We read ∀ xP(x) as “for all xP(x)” or “for every xP(x).” An element for which P(x) is false is called a counter- example of ∀ xP(x). Definition 3 The existential quantification of P(x) is the proposition “There exists an element x in the domain such that P(x).” We use the notation ∃ xP(x) for the existential quantification of P(x). Here ∃ is called the existential quantifier.Quantifiers Summation Statement When True? When False? ∀ xP(x) P(x) is true for every x. There is an x for which P(x) is false. ∃ xP(x) There is an x for which P(x) is true. P(x) is false for every x.Example 4 (2 points) Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification∀ xP(x), where the domain consists of all real numbers?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
8. 8. 18 CSC1001 Discrete Mathematics 04 - LogicExample 5 (2 points) Let Q(x) be the statement “x < 2.” What is the truth value of the quantification ∀ xQ(x),where the domain consists of all real numbers?Example 6 (2 points) Suppose that P(x) is “x2 > 0.” To show that the statement ∀ xP(x) is false where theuniverse of discourse consists of all integers, we give a counterexample. We see that x = 0 is a counter-example because x2 = 0 when x = 0, so that x2 is not greater than 0 when x = 0.Example 7 (2 points) What is the truth value of ∀ xP(x), where P(x) is the statement “x2 < 10” and the domainconsists of the positive integers not exceeding 4?Example 8 (2 points) Let P(x) denote the statement “x > 3.” What is the truth value of the quantification∃ xP(x), where the domain consists of all real numbers?Example 9 (2 points) Let Q(x) denote the statement “x = x + 1.”What is the truth value of the quantification∃ xQ(x), where the domain consists of all real numbers?Example 10 (2 points) What is the truth value of ∃ xP(x), where P(x) is the statement “x2 > 10” and theuniverse of discourse consists of the positive integers not exceeding 4?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี