Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

Discrete Math1

Uploaded by

mibib18138
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Discrete Math1

Uploaded by

mibib18138
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

MATH211

Discrete Mathematics
Instructor: Selin Selen Özbek Şimşek
E-mail: selin.ozbek@altinbas.edu.tr
Textbook: Discrete Mathematics and its Applications; Kenneth H. Rosen,
Seventh Edition, (2011)

Other Books :
• Discrete Mathematics with Applications; Susanna S. Epp, Fourth Edition,
Cengage Learning, (2010)
• Discrete Mathematics; Kenneth A. Ross, Charles R. Wright, Fifth Edition,
Prentice Hall (2002)

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Chapter 1:
The Foundations: • Basic concepts, logic, sets
Logic and Proofs

Course book.
Discrete Mathematics and its Applications;
Kenneth H. Rosen, Seventh Edition, (2011)

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


1.1 Propositional Logic

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

Example: All the following declarative sentences are propositions:

1. Washington, D.C., is the capital of the United States of America.


2. Toronto is the capital of Canada.
3. 1+1=2
4. 2+2=3
Propositions 1 and 3 are true, whereas 2 and 4 are false.

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: Consider the following sentences.

1. What time is it?


2. Read this carefully.
3. x+1=2
4. x+y=z
5. He is a successful student.
6. Let's go to the picnic.
Sentences 1,2 and 6 are not propositions because they are not declarative sentences.
Sentences 3, 4 and 5 are not propositions because they are neither true nor false.

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


truth value of a proposition is true, denoted by T, if it is a true proposition, and the truth
value of a proposition is false, denoted by F, if it is a false proposition. Many mathematical
statements are constructed by combining one or more propositions. New propositions,
called compound propositions, are formed from existing propositions using logical
operators.
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Now we define these operators :

Definition 1:

Example: Find the negation of the proposition:


1. p: 11 is a prime number.
¬𝑝: 11 is not a prime number.
2. q: 𝑥 2 < 7
¬𝑞: 𝑥 2 ≥ 7

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Definition:

Example: Find 𝑝⋀𝑞


1. p: −8 < 0 q: 0 < 8
𝑝⋀𝑞 : −8 < 0 and 0 < 8 The truth table of 𝒑⋀𝒒

2. p :6 is an even number. q: 10 is an odd number. p q 𝑝⋀𝑞


𝑝⋀𝑞 : 6 is an even number and 10 is an odd number. T T T
T F F
3. p: 9 is a prime number. q: 9 < 20
𝑝⋀𝑞 : 9 is a prime number and 9 < 20 . F T F
F F F
4. p: 13 is a positive multiple of 7. q: 13 < 7
𝑝⋀𝑞 : 13 is a positive multiple of 7 and 13 < 7 .
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Definition:

Example: Find 𝑝⋁𝑞 .


1. p: 10 is an irrational number. q: 7 < 0. The truth table of 𝒑⋁𝒒
𝒑⋁𝒒: 10 is an irrational number or 7 < 0 p q 𝑝⋁𝑞
T T T
2. p: 2 is a prime number. q:7>5.
T F T
𝒑⋁𝒒: 2 is a prime number or 7>5
F T T
3. p: -6<3 . q: 3 is an even prime number. F F F
𝒑⋁𝒒: -6<3 or 3 is an even prime number

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Conditional Statements
Definition:

Example: Find 𝑝 → 𝑞.
1. p :2<1 , q: 2<3 𝑝 → 𝑞 :2 < 1 → 2 < 3 The truth table of 𝒑 → 𝒒
p q 𝑝→𝑞
2. p: 2 and 3 are prime numbers. q: 6 isn’t a prime number. T T T
𝑝 → 𝑞: If 2 and 3 are prime numbers, then 6 isn’t a prime number
T F F
3. p: 8<3 , q:8<4 𝑝 → 𝑞: If 8<3 , then 8<4. F T T
F F T

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Converse, Contrapositive and Inverse
We can form some new conditional statements starting with a conditional statement 𝑝 → 𝑞 .
In particular, there are three related conditional statements that occur so often that they
have special names :
1) Contrapositive ¬𝑞 → ¬𝑝 (only the contrapositive always has the same truth value as
p → q)
2) Converse 𝑞 → 𝑝
3) Inverse ¬𝑝 → ¬𝑞
p ¬𝑝 q ¬𝑞 𝑝→𝑞 ¬𝑞 → ¬𝑝 𝑞→𝑝 ¬𝑝 → ¬𝑞
T F T F T T T T
T F F T F F T T
F T T F T T F F
F T F T T T T T

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


When two compound propositions always have the same truth value we call
them equivalent. So that

 the conditional statement(p → q) and its contrapositive(¬𝑞 → ¬𝑝) are equivalent,


 the Converse(𝑞 → 𝑝) and the inverse(¬𝑝 → ¬𝑞) of a conditional statement are also
equivalent.

Example: 𝑝 → 𝑞 :If it is raining, then the home team wins.

1) Contrapositive ¬𝑞 → ¬𝑝 : If the home team does not win, then it is not raining.
2) Converse 𝑞 → 𝑝 : If the home team wins, then it is raining.
3) Inverse ¬𝑝 → ¬𝑞 : If it is not raining, then the home team does not win.

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Biconditionals

Definition:

• Note that p ↔ q has exactly the same truth value as (p → q) ∧ (q → p).


The truth table of 𝒑 ↔ 𝒒
There are some other common ways to express p ↔ q: p q 𝑝↔𝑞
T T T
• T F F

F T F

F F T
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Example:
p: You can take the flight.
q: You buy a ticket.

𝑝 ↔ 𝑞: You can take the flight if and only if you buy a ticket.

Example: «A prime number is even number if and only if it is 2»


Is the compound proposition true or false? p q 𝑝⋀𝑞
p: n is an even prime number. q: n=2 T T T
T F F
𝑝 → 𝑞 True and 𝑞 → 𝑝 True. Therefore 𝑝 ↔ 𝑞 is true. F T F
F F F

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: Construct the truth table of the compound proposition 𝑝 ∨ ¬𝑞 → 𝑝 ∧ 𝑞

p q 𝑝⋁𝑞 p q 𝑝⋀𝑞 p q 𝑝→𝑞


T T T T T T T T T
T F T T F F T F F
F T T F T F F T T
F F F F F F F F T
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Precedence of Logical Operators:

We can construct compound propositions Precedence Operator


using the negation operator and the logical
1 ¬
operators defined so far. We will generally use
parentheses to specify the order in which 2 ⋀
logical operators in a compound proposition
are to be applied. However, to reduce the 3 ∨
number of parentheses, we specify the
precedence levels of the logical operators and 4 →
negation operator in the table. 5 ↔

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


 Remark!
This rule may be difficult to remember. Therefore we will use parenthesis for «2 and 3» and
«4 and 5»
• We will use parentheses when the order of the disjunction(∨) and conjunction(⋀)
operators is at issue .
• We will use parentheses when the order of the conditional(→) operator and biconditional
(↔) operator is at issue.

Precedence Operator
Example:
1) ¬(p ∧ q) and ¬p ∧ q propositions are different to each other. 1 ¬
2) p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r). 2 ⋀
3) p ∨ q → r is the same as (p ∨ q) → r. 3 ∨
4 →
5 ↔

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


1.2. Propositional Equivalences:

Definition: 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.

Example: Consider the truth tables of 𝑝 ∨ ¬𝑝 and 𝑝 ∧ ¬𝑝.


𝑝 ∨ ¬𝑝 is a tautology
𝑝 ∧ ¬𝑝 is a contradiction
p q 𝑝⋁𝑞 p q 𝑝⋀𝑞
p ¬𝑝 𝑝 ∨ ¬𝑝 𝑝 ∧ ¬𝑝 T T T T T T
T F T F T F T T F F
F T T F F T T F T F
F F F F F F

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: 𝑝 ∧ 𝑞 ∨ ¬ 𝑝 ∧ 𝑞 is a tautology. (hint: 𝑝 ∧ 𝑞=r)

Definition: The compound propositions p and q are called logically equivalent if p ↔ q is a


tautology. The notation p ≡ q denotes that p and q are logically equivalent.

 One way to determine whether two compound propositions are equivalent is to use a
truth table. In particular, the compound propositions p and q are equivalent if and only if
the columns giving their truth values agree.

De Morgan Laws:
The following two examples illustrate this method to establish an extremely important and
useful logical equivalences. Thess logical equivalences are called De Morgan’s laws.
De Morgan’s Law
¬ 𝑝 ∧ 𝑞 ≡ ¬p∨ ¬q
¬ 𝑝 ∨ 𝑞 ≡ ¬p∧ ¬q
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Example:Show that ¬(p ∨ q) and ¬p ∧¬q are logically equivalent.

Example: Show that ¬(p ∧ q) and ¬p ∨ ¬q are logically equivalent.

p q 𝑝∧𝐪 ¬ 𝑝∧𝑞 ¬p ¬q ¬p∨ ¬q


T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: Show that 𝑝 → 𝑞 and ¬p∨q are logically equivalent:
p q 𝑝→𝑞 ¬p ¬p∨q
T T T F T
T F F F F
F T T T T
F F T T T
Example: Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent:

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Example: Show that ¬(p → q) and p ∧¬q are logically equivalent:

Example: Show that (p ∧ q) → (p ∨ q) is a tautology.(Note: This could also be done using a


truth table.)

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent by developing a
series of logical equivalences. Note: we could also easily establish this equivalence using a
truth table.)

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


1.3. Predicates and Quantifiers
Statements involving variables, such as.
𝑥 >3, 𝑥 = 𝑦 + 3
are often found in mathematical assertions. These statements are neither true nor false
when the values of the variables are not specified. In this section, we will discuss the ways
that propositions can be produced from such statements.
The statement “x is greater than 3” has two parts.
• The first part, the variable x, is the subject of the statement.
• The second part—the predicate, “is greater than 3”—refers to a property that

We can denote the statement “x is greater than 3” by 𝑷(𝒙), where P 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 propositional function P at x. Once a value has been assigned to the variable x,

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: Let P(x) denote the statement “x > 3.” What are the truth values of P(4) and P(2)?
Solution:
• We obtain the statement P(4) by setting x = 4 in the statement “x > 3.” Hence,
P(4), which is the statement “4 > 3,” is true. The truth values of P(4) is T.
• However, P(2), which is the statement “2 > 3,” is false. The truth values of P(2) is F.

We can also have statements that involve more than one variable. For instance,
consider the statement “x = y + 3.” We can denote this statement by Q(x, y), where x and y
are variables and Q is the predicate. When values are assigned to the variables x and y, the
statement Q(x, y) has a truth value.

Example: Let Q(x,y) denote the statement x=y+3 . What are the truth values of the
propositions Q(1,2) and Q(3,0)?
Solution: To obtain Q(1,2) set x=1 and y=2 in the statement Q(x, y). Hence, Q(1, 2) is the
statemen «1=2+3» which is false. The statement Q(3, 0) is the proposition “3 = 0 + 3,” which
is true.
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Quantifiers expresses the extent to which a predicate is true over a range of elements.

We will focus on two types of quantification here: universal quantification and existential
quantification.

Universal Quantification :

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Existential Quantification:

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Example: 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?
Solution: Because P(x) is true for all real numbers x, the quantification ∀xP(x) is true.
Example: 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?
Solution: Q(x) is not true for every real number x, because, for instance, Q(3) is false. That
is, x = 3 is a counterexample for the statement ∀xQ(x). Thus ∀xQ(x) is false.

Example: 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?
Solution: Because “x > 3” is sometimes true—for instance, when x = 4—the existential
quantification of P(x), which is ∃xP(x), is true.
Example: 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?
Solution: Because Q(x) is false for every real number x, the existential quantification of Q(x),
which is ∃xQ(x), is false.

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Negating Quantified Expressions
We will often want to consider the negation of a quantified expression.

For instance, consider the negation of the statement


“Every student in your class has taken a course in calculus.”
This statement is a universal quantification, namely, ∀xP(x), where P(x) is the statement
“x has taken a course in calculus” and the domain consists of the students in your class.
The negation of this statement is “It is not the case that every student in your class
has taken a course in calculus.” This is equivalent to “There is a student in your class who has
not taken a course in calculus.”
This is simply the existential quantification of the negation of the original
propositional function, namely, ∃x ¬P(x).
This example illustrates the following logical equivalence

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Suppose we wish to negate an existential quantification.
For instance, consider the proposition
“There is a student in this class who has taken a course in calculus.”
This is the existential quantification ∃xQ(x), where Q(x) is the statement “x has taken a
course in calculus.”
The negation of this statement is the proposition “It is not the case that there is
a student in this class who has taken a course in calculus.” This is equivalent to “Every
student in this class has not taken calculus,” which is just the universal quantification of
the negation of the original propositional function, namely, ∀x ¬Q(x).

This example illustrates the equivalence

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Example:What are the negations of the statements ∀𝑥 𝑥 2 > 𝑥 and ∃𝑥 𝑥 2 = 2 ?

Solution:
• The negation of ∀𝑥 𝑥 2 > 𝑥 is the statement ¬∀𝑥 𝑥 2 > 𝑥 , which is equivalent to
∃𝑥¬ 𝑥 2 > 𝑥 .This can be rewritten as ∃𝑥 𝑥 2 ≤ 𝑥 olarak da yazabiliriz.
• The negation of ∃𝑥 𝑥 2 = 2 is the statement ¬∃𝑥 𝑥 2 = 2 , which is equivalent to
∀𝑥¬ 𝑥 2 = 2 .This can be rewritten as ∀𝑥 𝑥 2 ≠ 2 .

Example: Show that ¬∀𝑥(𝑃(x)→ 𝑄(𝑥)) and ∃𝑥(𝑃(x)⋀¬𝑄 𝑥 ) are logically equivalent.

Solution: By De Morgan’s law for universal quantifiers, we know that ¬∀𝑥(𝑃(x)→ 𝑄(𝑥))
and ∃𝑥¬ (𝑃(x)→ 𝑄(𝑥)) are logically equivalent. By the logical equivalence in the previous
section, we know that 𝑃(x)→ 𝑄(𝑥) ≡ ¬𝑃(x) ∨ 𝑄 𝑥 . We obtain

¬∀𝑥(𝑃(x)→ 𝑄(𝑥)) ≡ ∃𝑥¬ (𝑃(x)→ 𝑄(𝑥)) ≡ ∃𝑥¬ (¬𝑃(x) ∨ 𝑄 𝑥 ) ≡ ∃𝑥(𝑃(x)⋀¬𝑄 𝑥 ).

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Nested Quantifiers

Consider the statement


∀𝑥∃𝑦 𝑥 + 𝑦 = 0
Everything within the scope of a quantifier can be thought of as a propositional function.
For example,
∀x∃y(x + y = 0)
is the same thing as ∀xQ(x), where Q(x) is ∃yP(x, y), where P(x, y) is x + y = 0.

Example: Assume that the domain for the variables x and y consists of all real numbers.
The statement
∀x∀y(x + y = y + x)
says that x + y = y + x for all real numbers x and y.
Example: The statement
∀x∃y(x + y = 0)
says that for every real number x there is a real number y such that x + y = 0.
Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
The Order of the Quantifiers

It is important to note that the order of the quantifiers is important, unless all the
quantifiers are universal quantifiers or all are existential quantifiers.

Example: Let P(x,y) be the statement «𝑥 + 𝑦 = 0».

∀𝑥∃𝑦 𝑥 + 𝑦 = 0 The statement says that for every real number x there is a real number
y such that x + y = 0.

∃𝑦∀𝑥 𝑥 + 𝑦 = 0 The statement says that there is a real number y such that for every
real number x, x + y = 0.

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics
Negating Nested Quantifiers

Statements involving nested quantifiers can be negated by repeatedly applying the rules for
negating statements involving a single quantifier.

Example: Use quantifiers and predicates to express the fact that limx→a f (x) does not exist.
lim 𝑓(𝑥) ≠ 𝐿
𝑥→𝑎
Solution:
The definition of a limit: For every real number 𝜀> 0 there exists a real number δ > 0 such that
|f (x) − L| < 𝜀 whenever 0 < |x − a| < δ.

This definition of a limit can be phrased in terms of quantifiers by

Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics


Altınbaş Üniversitesi Selin Selen Özbek Şimşek selin.ozbek@altinbas.edu.tr MATH211-Discrete Mathematics

You might also like