discrete-chapter 04 logic part ii

8
11 มหาวิทยาลัยราชภัฏสวนสุนันทา (ภาคการศึกษาที2/2555) เรียบเรียงโดย .วงศ์ยศ เกิดศรี CSC1001 Discrete Mathematics Logic - 04 1. Logical Equivalences Example 1 (5 points) Show that ¬ (p q) and ¬ p ¬ q are logically equivalent by using truth tables. p q Example 2 (5 points) Show that p q and ¬ p q are logically equivalent by using truth tables. p q Example 3 (5 points) Show that p (q r) and (p q) (p r) are logically equivalent using truth tables. p q r Propositional Equivalences 2 A compound proposition that is always true, no matter what the t ruth 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 1 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. Definition 2

Upload: wongyos-keardsri

Post on 25-May-2015

127 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discrete-Chapter 04 Logic Part II

11

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Logic - 04

1. Logical Equivalences

Example 1 (5 points) Show that ¬ (p ∨ q) and ¬ p ∧ ¬ q are logically equivalent by using truth tables.

p q

Example 2 (5 points) Show that p → q and ¬ p ∨ q are logically equivalent by using truth tables.

p q

Example 3 (5 points) Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent using truth tables.

p q r

Propositional Equivalences 2

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 1

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.

Definition 2

Page 2: Discrete-Chapter 04 Logic Part II

12

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 04 - Logic

Example 4 (5 points) Show that p ↔ q ≡ (p ∧ q) ∨ (¬ p ∧ ¬ q) by using truth tables.

p q

Example 5 (5 points) Show that (p → q) ∧ (p → r) ≡ p → (q ∧ r) by using truth tables.

p q r

Example 6 (5 points) Show that (p → q) ∨ (p → r) ≡ p → (q ∨ r) by using truth tables.

p q r

2. Laws of Logical Equivalences

Equivalence Name / Laws

p ∧ T ≡ p p ∨ F ≡ p

Identity laws

p ∨ T ≡ T p ∧ F ≡ F

Domination laws

p ∨ p ≡ p p ∧ p ≡ p

Idempotent laws

Page 3: Discrete-Chapter 04 Logic Part II

13

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Logic - 04

Equivalence Name / Laws ¬ (¬ p) ≡ p Double negation law p ∨ q ≡ q ∨ p p ∧ q ≡ q ∧ p

Commutative laws

(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)

Associative laws

p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)

Distributive laws

¬ (p ∧ q) ≡ ¬ p ∨ ¬ q ¬ (p ∨ q) ≡ ¬ p ∧ ¬ q

De Morgan’s laws

p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p

Absorption laws

p ∨ ¬ p ≡ T p ∧ ¬ p ≡ F

Negation laws

p → q ≡ ¬ p ∨ q Conditional statements p ↔ q ≡ (p → q) ∧ (q → p) Biconditional statements

Example 7 (5 points) Show that ¬ (p → q) and p ∧ ¬ q are logically equivalent by using laws of logical equivalences

Example 8 (5 points) Show that ¬ (p ∨ (¬ p ∧ q)) and ¬ p ∧ ¬ q are logically equivalent by using laws of logical equivalences

Page 4: Discrete-Chapter 04 Logic Part II

14

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 04 - Logic

Example 9 (5 points) Show that p → q ≡ ¬ q → ¬ p are logically equivalent by using laws of logical equivalences

Example 10 (5 points) Show that p ∨ q ≡ ¬ p → q are logically equivalent by using laws of logical equivalences

Example 11 (5 points) Show that p ∧ q ≡ ¬ (p → ¬ q) are logically equivalent by using laws of logical equivalences

Example 12 (5 points) Show that ¬ (p → q) ≡ p ∧ ¬ q are logically equivalent by using laws of logical equivalences

Page 5: Discrete-Chapter 04 Logic Part II

15

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Logic - 04

Example 13 (5 points) Show that (p → q) ∧ (p → r) ≡ p → (q ∧ r) are logically equivalent by using laws of logical equivalences

Example 14 (5 points) Show that (p → r) ∨ (q → r) ≡ (p ∧ q) → r are logically equivalent by using laws of logical equivalences

Example 15 (5 points) Show that p ↔ q ≡ ¬ p ↔ ¬ q are logically equivalent by using laws of logical equivalences

Example 16 (5 points) Show that p ↔ q ≡ (p ∧ q) ∨ (¬ p ∧ ¬ q) are logically equivalent by using laws of logical equivalences

Page 6: Discrete-Chapter 04 Logic Part II

16

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 04 - Logic

Example 17 (5 points) Show that ¬ (p ↔ q) ≡ p ↔ ¬ q are logically equivalent by using laws of logical equivalences

Example 18 (5 points) Show that (p ∧ q) → (p ∨ q) is a tautology by using laws of logical equivalences

Example 19 (5 points) Show that (p → q) ∧ (q → r) → (p → r) is a tautology by using laws of logical equivalences

1. Predicates

Example 1 (2 points) Let P(x) denote the statement “x > 3” What are the truth values of P(4) and P(2)?

Predicates and Quantifiers 3

Predicates are the statements that involving variables, for example “x = y + 3,” “computer x is under attack”Definition 1

Page 7: Discrete-Chapter 04 Logic Part II

17

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Logic - 04

Example 2 (2 points) Let A(x) denote the statement “Computer x is under attack by an intruder.” Suppose that of the computers on campus, only CS2 and MATH1 are currently under attack by intruders. What are truth values 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

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?

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 2

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.

Definition 3

Page 8: Discrete-Chapter 04 Logic Part II

18

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 04 - Logic

Example 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 the universe 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 domain consists 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 the universe of discourse consists of the positive integers not exceeding 4?