85
ECOM 2311- Discrete Mathematics Chapter # 1 : The Foundations: Logic and Proofs Fall, 2013/2014 ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 1 / 85

ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Embed Size (px)

Citation preview

Page 1: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

ECOM 2311- Discrete Mathematics

Chapter # 1 : The Foundations: Logic and Proofs

Fall, 2013/2014

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 1 / 85

Page 2: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Outline

1 Propositional Logic

2 Propositional Equivalences

3 Predicates and Quantifiers

4 Nested Quantifiers

5 Rules of Inference

6 Introduction to Proofs

7 Proof Methods and Strategy

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 2 / 85

Page 3: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicMotivations

For every positive integer n, the sum of the positive integers notexceeding n is n(n + 1)/2.

Mathematical Statement + Proof = Theorem

Proofs are important throughout mathematics, but how importantproofs are in computer science?.

Verify that computer programs produce the correct output for allpossible input values.Show that algorithms always produce the correct result.Establish the security of a system.

What we are going to learn in this chapter?

Introduce tools to construct a correct mathematical arguments.Develop different proof methods that will enable us to prove manydifferent types of results.Introduce several strategies for constructing proofs.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 3 / 85

Page 4: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicIntroduction

A proposition

a declarative sentence (that is, a sentence that declares a fact) that iseither true or false, but not both.

All the following declarative sentences are propositions.

”G” comes after ”F” in the English alphabetic.Toronto is the capital of Canada.1 + 1 = 2.2 + 2 = 3.

Propositions 1 and 3 are true, whereas 2 and 4 are false.

Consider the following sentences:

What time is it?, Read this carefully.I hope I can get above 90 in discrete mathematics.x + 1 = 2.

Sentences 1 and 2 are not propositions because they are notdeclarative sentences. Sentence 3 is not proposition because it isneither true nor false.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 4 / 85

Page 5: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicIntroduction

Is it a proposition?

Hello, How are you?.

NO

We can eat rocks.

YES

Ahmad taller than Ali.

YES

He is a good student.

NO

Please wakeup.

NO

15 * Z >= 30.

NO

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 5 / 85

Page 6: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicIntroduction

We use letters to denote propositional variables (or statementvariables).

The conventional letters used for propositional variables arep, q, r , s, . . . .

The truth value of a proposition is true, denoted by T, if it is atrue proposition, and the truth value of a proposition is false,denoted by F, if it is a false proposition.

DEFINITION

Let p be a proposition. The negation of p, denoted by ⇁ p (alsodenoted by p̄), is the statement”It is not the case that p.”The proposition ⇁ p is read ”not p.” The truth value of the negation ofp, ⇁ p, is the opposite of the truth value of p.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 6 / 85

Page 7: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicIntroduction

Ex. Find the negation of the proposition”Michaels PC runs Linux”and express this in simple English.

Solution: The negation is ”It is not the case that Michaels PC runsLinux.”

This negation can be more simply expressed as ”Michaels PC doesnot run Linux.”

———————————————————————Ex. Find the negation of the proposition ”Jessica’s smartphone hasat least 32GB of memory” and express this in simple English.

Solution: The negation is ”It is not the case that Jessica’ssmartphone has at least 32GB of memory.”

This negation can also be expressed as ”Jessica’s smartphone doesnot have at least 32GB of memory”

or even more simply as ”Jessica’s smartphone has less than 32GB ofmemory.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 7 / 85

Page 8: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicIntroduction

The truth table for the negation of a proposition p.

Connectives

The logical operators that are used to form new propositions from two ormore existing propositions.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 8 / 85

Page 9: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicCompound Propositions

Conjunction

Let p and q be propositions. The conjunction of p and q, denoted byp ∧ q, is the proposition of ”p and q”. The conjunction p ∧ q is truewhen both p and q are true and is false otherwise.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 9 / 85

Page 10: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicCompound Propositions

Example: Find the conjunction of the propositions p and q where pis the proposition ”Rebeccas PC has more than 16 GB free hard diskspace” and q is the proposition ”The processor in Rebeccas PC runsfaster than 1 GHz.”

The conjunction of these propositions, p ∧ q, is the proposition”Rebecca’s PC has more than 16 GB free hard disk space, and theprocessor in Rebecca’s PC runs faster than 1 GHz.”

This conjunction can be expressed more simply as ”Rebecca’s PChas more than 16 GB free hard disk space, and its processor runsfaster than 1 GHz”.

For this conjunction to be true, both conditions given must be true.It is false, when one or both of these conditions are false.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 10 / 85

Page 11: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicCompound Propositions

Disjunction

Let p and q be propositions. The disjunction of p and q, denoted byp ∨ q, is the proposition of ”p or q”. The disjunction p ∨ q is false whenboth p and q are false and is true otherwise.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 11 / 85

Page 12: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicCompound Propositions

Exclusive or

Let p and q be propositions. The exclusive or of p and q, denoted byp ⊕ q, is the proposition that is true when exactly one of p and q is trueand is false otherwise.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 12 / 85

Page 13: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicCompound Propositions

Example: If the proportions p and q are: ”Students who havetaken calculus can take this course” and ”Students who have takencomputer science can take this course”, what is the differencebetween the connection using inclusive and exclusive or?

Inclusive or: ”Students who have taken calculus or computerscience can take this class.”

Here we mean that students who have taken both calculus andcomputer science can take the class, as well as the students whohave taken only one of the two subjects.

Exclusive or: ”Students who have taken calculus or computerscience, but not both, can enroll in this class.”

Here, we mean that students who have taken both calculus and acomputer science course cannot take the class. Only those who havetaken exactly one of the two courses can take the class.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 13 / 85

Page 14: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicConditional Statements

Conditional Statement

Let p and q be propositions. The conditional statement p → q is theproposition ”if p, then q”. The conditional statement p → q is falsewhen p is true and q is false, and true otherwise. In the conditionalstatement p → q, p is called the hypothesis (or antecedent or premise)and q is called the conclusion (or consequence).

”If I am elected, then I will lowertaxes.”

”If you get 100% on the final, thenyou will get an excellent.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 14 / 85

Page 15: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicConditional Statements

A variety of terminology is used to express p → q. You willencounter most if not all of the following ways to express thisconditional statement:

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 15 / 85

Page 16: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicConditional Statements

Example: If the proportions p and q are: ”Ali studies discretemathematics” and ”Ali will get a good grade.” Express thestatement p → q as a statement in English using ”if p, then q”,”q when p” and ”q unless ⇁ p”.

”If Ali studies discrete mathematics, then he will get a good grade.”.

”Ali will get a good grade when he studies discrete mathematics.”

”Ali will get a good grade unless he does not study discretemathematics”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 16 / 85

Page 17: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicConditional Statements

There are three related conditional statements that occur so often thatthey have special names:

The converse of p → q is the preposition q → p.

The contrapositive of p → q is the preposition ⇁ q →⇁ p.

The inverse of p → q is the preposition ⇁ p →⇁ q.

Only the contrapositive always has the same truth value as p → q.

The converse and the inverse of a conditional statement are alsoequivalent [check that], but neither is equivalent to the originalconditional statement.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 17 / 85

Page 18: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicConditional Statements

Example: What are the contrapositive, the converse, and theinverse of the conditional statement ”The home team wins wheneverit is raining?”.

Because ”q whenever p” is one of the ways to express theconditional statement ”p → q, the original statement can berewritten as ”If it is raining, then the home team wins”.Consequently,

The contrapositive is: ”If the home team does not win, then it isnot raining.”

The converse is: ”If the home team wins, then it is raining.”

The inverse is: ”If it is not raining, then the home team does notwin.”

Only the contrapositive is equivalent to the original statement.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 18 / 85

Page 19: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicBiconditional Statements

Biconditional Statement

Let p and q be propositions. The biconditional statement p ↔ q is theproposition ”p if and only if q.” The biconditional statement p ↔ q istrue when p and q have the same truth values, and is false otherwise.Biconditional statements are also called bi-implications.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 19 / 85

Page 20: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicBiconditional Statements

The statement p ↔ q is true when both the conditional statementsp → q and q → p are true and is false otherwise.

There are some other common ways to express p ↔ q: ”p isnecessary and sufficient for q”, ”if p then q, and conversely” and ”piff q”.

As we will take later, you will find that p ↔ q has exactly the sametruth table as (p → q) ∧ (q → p).

Example: Let p be the statement ”You can take the flight” and letq be the statement ”You buy a ticket.” Then p ↔ q is thestatement ”You can take the flight if and only if you buy a ticket.”

This statement is true if p and q are either both true or both false, thatis, if you buy a ticket and can take the flight or if you do not buy a ticketand you cannot take the flight. It is false when p and q have oppositetruth values.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 20 / 85

Page 21: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicPrecedence of Logical Operators

The operators have the following order of precedence:

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 21 / 85

Page 22: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional LogicTruth Tables of Compound Propositions

Construct the truth table of the compound proposition:

(p∨⇁ q)→ (p ∧ q)

Exercise: repeat for

p →⇁ (p ∨ q) Ans:[F F T T]

(⇁ p ∧ q)↔ (p ∨ q) Ans:[F F T T]

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 22 / 85

Page 23: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesIntroduction

The compound propositions are classified according to their possibletruth values to:

Tautology: A compound proposition that is always true, no matterwhat the truth values of the propositional variables that occur in it.Example: p ∨ (⇁ p)

Contradiction: A compound proposition that is always falseExample: p ∧ (⇁ p)

Contingency: A compound proposition that is neither a tautologynor a contradiction.

Exercise:What about ⇁ (p ∧ q)↔ (⇁ p) ∨ (⇁ q)?.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 23 / 85

Page 24: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Compound propositions that have the same truth values in all possiblecases are called logically equivalent.

Another Definition

The compound propositions p and q are called logically equivalent ifp ↔ q is a tautology. The notation p ≡ q denotes that p and q arelogically equivalent.

General Remarks:

The symbol ≡ is not a logical connective, and p ≡ q is not acompound proposition but rather is the statement that p ↔ q is atautology.

The symbol ⇔ is sometimes used instead of ≡ to denote logicalequivalence.

The compound propositions p and q are equivalent if and only if thecolumns giving their truth values agree.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 24 / 85

Page 25: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that ⇁ (p ∨ q) and ⇁ p∧⇁ q are logicallyequivalent

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 25 / 85

Page 26: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that p → q and ⇁ p ∨ q are logically equivalent

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 26 / 85

Page 27: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logicallyequivalent. This is the distributive law of disjunction overconjunction.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 27 / 85

Page 28: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 28 / 85

Page 29: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 29 / 85

Page 30: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 30 / 85

Page 31: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that ⇁ (p → q) and p∧⇁ q are logicallyequivalent

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 31 / 85

Page 32: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that ⇁ (p ∨ (⇁ p ∧ q)) and ⇁ p∧⇁ q arelogically equivalent by developing a series of logical equivalences.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 32 / 85

Page 33: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Propositional EquivalencesLogical Equivalences

Example: Show that (p ∧ q)→ (p ∨ q) is a tautology.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 33 / 85

Page 34: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Homework due to 24th of Sept.From the text book, Section 1.1, page 12Questions: Q1,Q3,Q9 [parts a,c,h], Q16, Q27[part a], Q31[parts a,c,e]and Q33[part e].

Homework due to 29th of Sept.From the text book, Section 1.3, page 34Questions: Q3 [part a],Q5,Q9 [part c], Q10 [only repeat for Q9(c)] andQ23.

Page 35: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersIntroduction

”Every computer connected to the university network is functioningproperly.” Is it a proposition?

In this section we will introduce a more powerful type of logic calledpredicate logic.

Statements involving variables, such as ”x > 3,” is neither true norfalse when the values of the variables are not specified.

The statement x > 3 has two parts:

The subject: the variable x .The predicate: ”is greater than 3” refers to a property that thesubject of the statement can have.

We can denote the statement ”x is greater than 3” by P(x), whereP denotes the predicate ”is greater than 3” and x is the variable.

The statement P(x) is also said to be the value of the propositionalfunction P at x .

Once a value has been assigned to the variable x , the statementP(x) becomes a proposition and has a truth value.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 35 / 85

Page 36: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersPredicates

Example: Let P(x) denote the statement ”x > 3.” What are thetruth values of P(4) and P(2)?

P(4), ”4 > 3”, True.

P(2), ”2 > 3”, False.

Example: Let Q(x , y) denote the statement ”x = y + 3.” What arethe truth values of the propositions Q(1, 2) and Q(3, 0)?

Q(1, 2), ”1 = 2 + 3”, False.

Q(3, 0), ”3 = 0 + 3”, True.

Exercise:Let R(x , y , z) denote the statement ”x + y = z”. What are the truthvalues of the propositions R(1, 2, 3) and R(0, 0, 1)?

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 36 / 85

Page 37: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersQuantifiers

The universal quantification

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).

∀ 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 counterexample of∀xP(x).

The existential quantification

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.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 37 / 85

Page 38: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersQuantifiers

What are the truth values of the quantification ∀xP(x) for the followingstatements:

P(x) is ”x + 1 > x”, D : Real No.’s.True for all real numbers ⇒ True.

P(x) is ”x < 2”, D : Real No.’s.P(3) is false. That is, x = 3 is a counterexample for the statement”∀xP(x)” ⇒ False.

P(x) is ”x2 > 0”, D : All integers.We see that x = 0 is a counterexample because x2 = 0 when x = 0,so that x2 is not greater than 0 when x = 0. ⇒ False.

P(x) is ”x2 < 10”, D : +ve integers not exceeding 4.∀xP(x) = P(1) ∧ P(2) ∧ P(3) ∧ P(4). Because P(4), which is thestatement ”42 < 10,” is false ⇒ ∀xP(x) is False.

P(x) is ”x2 ≥ x”, D : Real No.’s∀x(x2 ≥ x) is false if the domain consists of all real numbers.However, its True if the domain consists of the integers No’s only.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 38 / 85

Page 39: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersQuantifiers

What are the truth values of the quantification ∃xP(x) for the followingstatements:

P(x) is ”x > 3”, D : Real No.’s.Because ”x > 3” is sometimes true, for instance, when x = 4 ⇒ theexistential quantification of P(x) is True.

P(x) is ”x = x + 1”, D : Real No.’s.Because P(x) is false for every real number x ⇒ the existentialquantification of P(x) is False.

P(x) is ”x2 > 10”, D : +ve integers not exceeding 4.∃xP(x) = P(1) ∨ P(2) ∨ P(3) ∨ P(4). Because P(4), which is thestatement ”42 > 10,” is True ⇒ ∃xP(x) is True.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 39 / 85

Page 40: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersQuantifiers

The uniqueness quantification

The uniqueness quantifier of P(x) is the statement”There exists a unique x such that P(x) is true.”The notation ∃!xP(x) or ∃1xP(x) denotes the uniqueness quantificationof P(x).Example: ∃1x(x − 1 = 0) with D : is the set of real numbers is a Truestatement.

Quantifiers with Restricted Domains

The domain of a quantifier can be restricted in an abbreviated form byusing a condition on the variable that is included after the quantifier.Example: ∀x < 0(x2 > 0) states that ”The square of a negative realnumber is positive.”This statement is the same as ∀x(x < 0→ x2 > 0).

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 40 / 85

Page 41: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersPrecedence of Quantifiers

The quantifiers ∀ and ∃ have higher precedence than all logicaloperators from propositional calculus.

Example: ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x).

In other words, it means (∀xP(x)) ∨ Q(x) rather than∀x(P(x) ∨ Q(x)).

Logical Equivalences Involving Quantifiers

Statements involving predicates and quantifiers are logically equivalent ifand only if they have the same truth value no matter which predicatesare substituted into these statements and which domain of discourse isused for the variables in these propositional functions. We use thenotation S ≡ T to indicate that two statements S and T involvingpredicates and quantifiers are logically equivalent.Example: ∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x)

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 41 / 85

Page 42: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersNegating Quantified Expressions

⇁ ∀xP(x) ≡ ∃x ⇁ P(x)

Let P(x) denotes the statement ”x knows Java programming”, andlet the universe of discourse be all the students in your class.

∀xP(x) means all the students in your class know Javaprogramming.

The negation: ”not all the students in your class know Javaprogramming”.

Or: ”there exists at least one student in your class who does notknow Java programming”.

This is equivalent to ∃x ⇁ P(x)

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 42 / 85

Page 43: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersNegating Quantified Expressions

⇁ ∃xP(x) ≡ ∀x ⇁ P(x)

Let P(x) denotes the statement ”x knows Java programming”, andlet the universe of discourse be all the students in your class.

∃xP(x) means there exists at least one student in your class whoknows Java programming.

The negation: ”all the students in your class do not know Javaprogramming”.

This is equivalent to ∀x ⇁ P(x)

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 43 / 85

Page 44: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Predicates and QuantifiersNegating Quantified Expressions

Example: What are the negations of the statements ∀x(x2 > x)and ∃x(x2 = 2)?

The negation of ∀x(x2 > x) is ⇁ ∀x(x2 > x).

This is equivalent to ∃x ⇁ (x2 > x).

This can be written as ∃x(x2 ≤ x).

The negation of ∃x(x2 = 2) is ⇁ ∃x(x2 = 2).

This is equivalent to ∀x ⇁ (x2 = 2).

This can be written as ∀x(x2 6= 2).

Exercise:Show that ⇁ ∀x(P(x)→ Q(x)) and ∃x(P(x)∧⇁ Q(x)) are logicallyequivalent.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 44 / 85

Page 45: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersIntroduction

Nested Quantifiers

Its the statements that have one Quantifier within the scope of another.Examples:

∀x∃yP(x , y)”For all x , there exists a y such that P(x , y).”Example: ∀x∃y(x + y = 0).

∃x∀yP(x , y)”There exists an x , such that for all y P(x , y) is true.”Example: ∃x∀y(x ∗ y = 0).

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 45 / 85

Page 46: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersUnderstanding Statements Involving Nested Quantifiers

Example: Translate the following statements into English where thedomain is all the real numbers:

∀x∃y(x + y = 0)Every real number has an additive inverse.

∀x∀y((x > 0) ∧ (y < 0)→ (xy < 0))The product of a positive real number and a negative real number isalways a negative real number.

∀x∀y(x + y = y + x)This is the commutative law for addition of real numbers.

∀x∀y∀z(x + (y + z) = (x + y) + z)This is the associative law for addition of real numbers.

∀x∃y(((x ≥ 0) ∧ (y < 0))→ (x − y > 0))A non-negative number minus a -ve number is greater than zero.

∃x∃y(((x ≤ 0) ∧ (y ≤ 0)) ∧ (x − y > 0))The difference between two non-positive numbers is not necessarilynon-positive (i.e. can be +ve)

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 46 / 85

Page 47: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersUnderstanding Statements Involving Nested Quantifiers

Exercise:∀x∀y(((x 6= 0) ∧ (y 6= 0))↔ (xy 6= 0))

Example: Translate the following English statement into logicalexpression:

”The sum of two positive integers is always positive”.

We first rewrite the sentence ”For every two integers, if these integersare both positive, then the sum of these integers is positive.”Next, we introduce the variables x and y to obtain ”For all positiveintegers x and y , x + y is positive.”Consequently, we can express this statement as:∀x∀y((x > 0) ∧ (y > 0)→ (x + y > 0)), where the domain consistsof all integers.If the domain is all positive integers, then the statement can bewritten as ”For every two positive integers, the sum of these integersis positive”, and can be expressed mathematically as:∀x∀y(x + y > 0).

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 47 / 85

Page 48: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersUnderstanding Statements Involving Nested Quantifiers

Example: Translate the following English statement into logicalexpression:

”Every real number except zero has a multiplicative inverse”.

We first rewrite the sentence ”For every real number x except zero, xhas a multiplicative inverse.”Next, we introduce the variables x and y to obtain ”For every realnumber x , if x 6= 0, then there exists a real number y such thatxy = 1.”Consequently, we can express this statement as:∀x((x 6= 0)→ ∃y(xy = 1)).

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 48 / 85

Page 49: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersTranslating English Sentences into Logical Expressions

Example: Translate the following English statement into into logicalexpression:

”Any student either has a computer or has a friend that has acomputer. ”.

”For any student x, x has a computer or there is some student ywhere y has a computer and x and y are friends.”Consequently, we can express this statement as:

∀x(C (x) ∨ ∃y [C (y) ∧ F (x , y)]).where:

C(x) is ”x has a computer”.F (x , y) is ”x and y are friends”.Universe of discourse for x and y is all students.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 49 / 85

Page 50: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersThe Order of Quantifiers

The order of the quantifiers is important unless all the quantifiersare universal quantifiers or all are existential quantifiers.

The order of nested universal quantifiers (or existential quantifiers)in a statement without other quantifiers can be changed withoutchanging the meaning of the quantified statement.

Example: ∀x∀y(x + y = y + x) ≡ ∀y∀x(x + y = y + x).

The order in which quantifiers appear when there is different typesmakes a difference.

Example: the statements ∃x∀y(x + y = 0) and ∀x∃y(x + y = 0)are not logically equivalent. (WHY??)

Exercise:Let Q(x , y , z) be the statement ”x + y = z”. What are the truthvalues of the statements ∀x∀y∃zQ(x , y , z) and ∃z∀x∀yQ(x , y , z),where the domain of all variables consists of all real numbers?

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 50 / 85

Page 51: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersThe Order of Quantifiers

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 51 / 85

Page 52: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Nested QuantifiersNegating Nested Quantifiers

Statements involving nested quantifiers can be negated bysuccessively applying the rules for negating statements involving asingle quantifier.

Example #1:⇁ ∀x∃y(xy = 1)≡ ∃x ⇁ ∃y(xy = 1)≡ ∃x∀y ⇁ (xy = 1)≡ ∃x∀y(xy 6= 1)

Example #2:⇁ ∀x∃y∀zP(x , y , z)≡ ∃x ⇁ ∃y∀zP(x , y , z)≡ ∃x∀y ⇁ ∀zP(x , y , z)≡ ∃x∀y∃z ⇁ P(x , y , z)

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 52 / 85

Page 53: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceValid Arguments in Propositional Logic

A correct (deductive) proof is to establish that

If the conditions are true then the conclusion is true.i.e., Conditions → conclusion is a tautology

Argument

An argument in propositional logic is a sequence of propositions. All butthe final proposition in the argument are called premises and the finalproposition is called the conclusion. An argument is valid if the truth ofall its premises implies that the conclusion is true.

Argument form

An argument form in propositional logic is a sequence of compoundpropositions involving propositional variables. The conclusion is true ifthe premises are all true.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 53 / 85

Page 54: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceValid Arguments in Propositional Logic

Ex. Determine whether the following argument is valid”If you have a current password, then you can log onto the network.””You have a current password.”Therfore”You can log onto the network.”

Task: determine whether the conclusion must be true when thepremises are both true.

Use p to represent ”You have a current password” and q torepresent ”You can log onto the network.”

Then, the argument has the form

where ∴ is the symbol that denotes ”therefore”.

The statement ((p → q) ∧ p)→ q is a tautology [modus ponens].

In particular, When both p → q and p are true, we know that qmust also be true and hence the argument is valid.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 54 / 85

Page 55: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Propositional Logic

Valid argument form

The argument form with premises p1, p2, · · · , pn and conclusion q isvalid, when (p1 ∧ p2 ∧ · · · ∧ pn)→ q is a tautology.

We can always use a truth table to show that an argument form isvalid. However, this can be a tedious approach.

Instead, we can first establish the validity of some relatively simpleargument forms, called rules of inference.

These rules of inference can be used as building blocks to constructmore complicated valid argument forms.

Exercise: Check the validity of the following arguments

((p → q) ∧ (q → r))→ (p → r).

”If I like DM, I will study it. Either I study DM or I fail the course.Therefore, If I fail the course, then I do not like DM”.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 55 / 85

Page 56: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Propositional Logic

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 56 / 85

Page 57: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Propositional Logic

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 57 / 85

Page 58: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Propositional Logic

State which rule of inference is the basis of the following arguments:

”It is below freezing now. Therefore, it is either below freezing orraining now.”

Let p be the proposition ”It is below freezing now” and q theproposition ”It is raining now.” Then this argument is of the form

[the addition rule].

”It is below freezing and raining now. Therefore, it is below freezingnow.”

Let p be the proposition ”It is below freezing now” and q theproposition ”It is raining now.” Then this argument is of the form

[the simplification rule].

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 58 / 85

Page 59: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Propositional Logic

State which rule of inference is the basis of the following argument:

”If it rains today, then we will not have a barbecue today. If we donot have a barbecue today, then we will have a barbecue tomorrow.Therefore, if it rains today, then we will have a barbecue tomorrow.”

Let p be the proposition ”It is raining today,” let q be theproposition ”We will not have a barbecue today,” and let r be theproposition ”We will have a barbecue tomorrow.” Then thisargument is of the form

[hypothetical syllogism].

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 59 / 85

Page 60: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceUsing Rules of Inference to Build Arguments

Example: Show that the premises ”It is not sunny this afternoon and itis colder than yesterday,” ”We will go swimming only if it is sunny,” ”Ifwe do not go swimming, then we will take a canoe trip,” and ”If we takea canoe trip, then we will be home by sunset” lead to the conclusion”We will be home by sunset.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 60 / 85

Page 61: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceUsing Rules of Inference to Build Arguments

Example: Show that the premises ”If you send me an e-mail message,then I will finish writing the program,” ”If you do not send me an e-mailmessage, then I will go to sleep early,” and ”If I go to sleep early, then Iwill wake up feeling refreshed,” lead to the conclusion ”If I do not finishwriting the program, then I will wake up feeling refreshed.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 61 / 85

Page 62: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceUsing Rules of Inference to Build Arguments

Example: Show that the premises ”Gary is either intelligent or a goodactor,” ”If Gary is intelligent, then he can count from 1 to 10,” and”Gary can only count from 1 to 3,” lead to the conclusion ”Gary is agood actor.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 62 / 85

Page 63: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Quantified Statements

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 63 / 85

Page 64: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Quantified Statements

Example: Show that the premises ”Everyone in this discretemathematics class has taken a course in computer science,” and ”Marlais a student in this class,” lead to the conclusion ”Marla has taken acourse in computer science.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 64 / 85

Page 65: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceRules of Inference for Quantified Statements

Example: Show that the premises ”A student in this class has not readthe book,” and ”Everyone in this class passed the first exam,” lead to theconclusion ”Someone who passed the first exam has not read the book.”

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 65 / 85

Page 66: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceCombining Rules of Inference for Propositions and Quantified Statements

Universal modus ponens

Universal modus tollens

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 66 / 85

Page 67: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of InferenceCombining Rules of Inference for Propositions and Quantified Statements

Example: Assume that ”For all positive integers n, if n is greater than 4,then n2 is less than 2n” is true. Use universal modus ponens to showthat 1002 < 2100.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 67 / 85

Page 68: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Rules of Inference

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 68 / 85

Page 69: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Homework due to 6th of Oct.From the text book, Section 1.4, page 53Questions: Q2,Q4, Q12[parts e,f], Q14[parts c,d], and Q18.From the text book, Section 1.5, page 64Questions: Q2,Q4 [parts a,d,f], Q24 [part a], Q26[parts e,g,h],Q28[parts f,h,j] and Q30[part a,c,e].From the text book, Section 1.6, page 78Questions: Q10[parts a,c,e], Q14[parts a,c] , Q16[parts a,c], Q24, andQ28.

Page 70: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsIntroduction

Proof

is a valid argument that establishes the truth of a mathematicalstatement.A proof can use the hypotheses of the theorem, if any, axioms assumedto be true, and previously proven theorems.

Types of Proofs:

Formal proofs [Used by computer programs]: show thatstatements involving propositions and quantified statements are trueby supplying all the steps and giving the rules for each step in theargument.Informal proofs [Used by humans]: more than one rule of inferencemay be used in each step, where steps may be skipped, where theaxioms being assumed and the rules of inference used are notexplicitly stated.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 70 / 85

Page 71: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsMethods of Proving Theorems / Direct proof

Direct proof

showing that a conditional statement p → q is true by showing that if pis true, then q must also be true, so that the combination p true and qfalse never occurs.

Give a direct proof of the following theorems:

”If n is an odd integer, then n2 is odd”.

Assume n is odd ⇔ n = 2k + 1, where k is an integer.n2 = (2k + 1)2

= (4k2 + 4k + 1) = 2(2k2 + 2k) + 1 = 2k̀ + 1Since n2 can be written in this form, it is odd.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 71 / 85

Page 72: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsMethods of Proving Theorems / Direct proof

Give a direct proof of the following theorems:

”If m and n are both perfect squares, then nm is also a perfectsquare. (An integer a is a perfect square if there is an integer b suchthat a = b2.)”.

Assume that n and m are perfect squares ⇔ n = t2 and m = s2,where s and t are integers.mn = s2t2

= (ss)(tt) = (st)(st) = (st)2 [using commutativity andassociativity of multiplication]Since mn can be written in this form, it is a perfect square.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 72 / 85

Page 73: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsMethods of Proving Theorems / Indirect proof

Proof by Contraposition

make use of the fact that the conditional statement p → q is equivalentto its contrapositive, ⇁ q →⇁ p.

Give an indirect proof of the following:

”if n is an integer and 3n + 2 is odd, then n is odd.”.

Assume that the conclusion q of this implication is false (n is even).Then use rules of inference and known theorems to show that thehypothesis p must also be false (3n + 2 is even).n is even ⇔ n = 2k where k is an integer.⇒ 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) = 2k̀Therefore 3n + 2 is even.We have shown that the contrapositive of the implication is true, sothe implication itself is also true (If 3n + 2 is odd, then n is odd).

Exercise show that ”if m + n > 50 then m > 25 or n > 25” where mand n are integers.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 73 / 85

Page 74: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsMethods of Proving Theorems / Indirect proof

Proof by Contradiction

reveal that p is true if we can show that ⇁ p → (r∧⇁ r) is true forsome proposition r .Way: assume ⇁ q and p and then deduce any contradiction.

Give an indirect proof of the following:

”if the square of an integer number is odd, then the integer is odd.”

Assume that the hypothesis p of this implication is true and theconclusion q is false (n is even). Then use rules of inference andknown theorems to deduce contradiction.Assume n2 is odd and n is not odd (even).⇒ n = 2k⇒ n2 = 4k2 = 2(2k2)Therefore n2 is even and is also odd by the assumption.We have a contradiction.

Exercise show that ”if 3n + 2 is odd, then n is odd”.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 74 / 85

Page 75: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsProofs of Equivalence

Prove the theorem:

”If n is an integer, then n is odd if and only if n2 is odd.”

This theorem has the form ”p if and only if q”, where p is ”n isodd” and q is ”n2 is odd.”

To prove this theorem, we need to show that p → q and q → p aretrue.

Because we have shown that both p → q and q → p [refer to thelast examples], we have shown that the theorem is true.

To prove that a group of statements are equivalent, we can establish anychain of conditional statements we choose as long as it is possible towork through the chain to go from any one of these statements to anyother statement. For example, we can show that p1, p2, and p3 areequivalent by showing that p1 → p3, p3 → p2, and p2 → p1.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 75 / 85

Page 76: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsProofs of Equivalence

Show that these statements about the integer n are equivalent:p1: n is even. p2: n − 1 is odd. p3: n2 is even.

We can show that these three statements are equivalent by showingthat the conditional statements p1 → p2, p2 → p3, and p3 → p1 aretrue.

p1 → p2 [Direct proof]: n is even ⇒ n = 2k for some integer k⇒ n − 1 = 2k − 1 = 2(k − 1) + 1⇒ n − 1 is odd.

p2 → p3 [Direct Proof]: n − 1 is odd ⇒ n − 1 = 2k + 1 for someinteger k⇒ n = 2k + 2 and n2 = (2k + 2)2 = 4k2 + 8k + 4 = 2(2k2 + 4k + 2)⇒ n2 is even.

p3 → p1 [Proof by Contraposition]: is equivalent to show that n isodd → n2 is odd (We proved this before).

This completes the proof.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 76 / 85

Page 77: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Introduction to ProofsMistakes in Proofs

Every step is valid except for one, step 5 where we divided both sides bya− b. The error is that a− b equals zero; division of both sides of an

equation by the same quantity is valid as long as this quantity is not zero.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 77 / 85

Page 78: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyExhaustive Proof and Proof by Cases

Proof by cases

The original conditional statement with a hypothesis made up of adisjunction of the propositions p1, p2, · · · , pn can be proved by provingeach of the n conditional statements pi → q, i = 1, 2, · · · , n, individually.

To prove a conditional statement of the formp1 ∨ p2 ∨ · · · pn → q,the tautology[(p1 ∨ p2 ∨ · · · pn)→ q]↔ [(p1 → q) ∧ (p2 → q) ∧ · · · (pn→ q)]can be used as a rule of inference.

Exhaustive proof

Proving by exhausting all possibilities [normally applicable when there issmall number of possibilities].

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 78 / 85

Page 79: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyExhaustive Proof and Proof by Cases

EX. Prove that (n + 1)3 ≥ 3n if n is positive integer with n ≤ 4.Using the method of exhaustion, we can verify that for the possiblevalues of n = 1, 2, 3, 4 that (n + 1)3 ≥ 3n.

Exercise: Prove that the only consecutive positive integers not exceeding50 that are perfect powers are 8 and 9. (An integer is a perfect power ifit equals na, where a is an integer greater than 1.)

EX. Prove that if n is an integer, then n2 ≥ n using proof by cases.We can prove that n2 ≥ n for every integer by considering three cases,when n = 0, when n ≥ 1, and when n ≤ −1.Case(i): n = 0⇒ 02 = 0⇒ n2 ≥ n for this case.Case(ii): n ≥ 1⇒ n.n ≥ 1.n⇒ n2 ≥ n for this case.Case(iii): n ≤ −1⇒ n2 ≥ 0⇒ n2 ≥ n for this case.Because the inequality holds in all three cases, we can conclude that if nis an integer, then n2 ≥ n.

Exercise: Use a proof by cases to show that |xy | = |x ||y |, where x and yare real numbers.[WLOG]

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 79 / 85

Page 80: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyExhaustive Proof and Proof by Cases

EX. Show by proof of cases that there are no solutions in integers x andy of x2 + 3y2 = 8.x2 and y2 are positive. Hence, to get x2 + 3y2 = 8, x2 or 3y2 should notexceeds 8.x2 ≤ 8⇒ x = 0,±1,±23y2 ≤ 8⇒ y = 0,±1The largest sum that we can get from these combinations is 7 and henceits impossible for x2 + 3y2 = 8 to hold if x and y are integers.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 80 / 85

Page 81: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyExhaustive Proof and Proof by Cases

EX. Show that if x and y are integers and both xy and x + y are even,then both x and y are even.We can proof using the proof by contraposition and the notion of(without loss of generality (WLOG)) and by proof by cases.First, suppose that x and y are not both even, that is x is odd or y isodd or both are odd.WLOG, assume that x is odd, ⇒ x = 2m + 1 for some integer m.To complete the proof we need to show that xy or x + y is odd. We havetwo cases:Case(i): y is even ⇒ y = 2n⇒ x + y = (2m + 1) + 2n = 2(m + n) + 1is odd.Case(ii): y is odd⇒ y = 2n + 1⇒ xy = (2m + 1) ∗ (2n + 1) = 2(2mn + m + n) + 1 is odd.which completes the proof.Note: WLOG means the inclusion of the case when y is assumed to beodd and then consider the two cases of x .

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 81 / 85

Page 82: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyExistence Proofs

Existence Proofs

A proof of a proposition of the form ∃xP(x).

A Constructive Existence Proof

finding an element a, called a witness, such that P(a) is true.

A Nonconstructive Existence Proof

we do not find an element a such that P(a) is true, but rather prove that∃xP(x) is true in some other way.

EX. Show that there is a positive integer that can be written as the sumof cubes of positive integers in two different ways.After considerable computation (such as a computer search) we find that1729 = 103 + 93 = 123 + 13.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 82 / 85

Page 83: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyUniqueness Proofs

Uniqueness Proofs

Show that an element with a given property exists and that no otherelement has this property.Existence: We show that an element x with the desired property exists.Uniqueness: We show that if y 6= x , then y does not have the desiredproperty.Equivalently, we can show that if x and y both have the desiredproperty, then x = y .

EX. Show that if a and b are real numbers and a 6= 0, then there is aunique real number r such that ar + b = 0.

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 83 / 85

Page 84: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

Proof Methods and StrategyFORWARD AND BACKWARD REASONING

EX. Show that for any two distinct real numbers x and y , the arithmeticmean (x + y)/2 is always greater than the geometric mean

√xy .

ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 84 / 85

Page 85: ECOM 2311- Discrete Mathematics10mm - الصفحات الشخصية ...site.iugaza.edu.ps/musbahshaat/files/chapter1_all...The conjunction of these propositions, p ^q, is the proposition

End of Chapter # 1