Chapter 1 Complete Slides
Chapter 1 Complete Slides
Discrete Mathematics
1
Learning Outcomes
On completion of the course, a student would be able to:
Describe mathematical arguments using logical connectives and
quantifiers.
Construct proofs using direct proof, proof by contraposition, proof
by contradiction, proof by cases, and mathematical induction.
Apply operations on discrete structures such as sets, functions,
relations, and sequences.
Apply algorithms and use definitions to solve problems to prove
statements in elementary Number Theory.
Know essential concepts in Graph Theory. 2
3
Outline
3
4 Methods of Assessments
4
Recommended Texts
5
5
Why Study Discrete Math?
The basis of all of digital information processing is: Discrete manipulations of discrete
structures represented in memory.
It’s the basic language and conceptual foundation for all of computer science.
Discretemath concepts are also widely used throughout math, science, engineering,
economics, biology, etc., …
6
The Foundations: Logic and
Proofs
Chapter 1
7
7
Chapter 01 Summary
🠶 Propositional Logic
🠶 The Language of Propositions
🠶 Applications
🠶 Logical Equivalences
🠶 Predicate Logic
🠶 Predicates
🠶 The Language of
Quantifiers
🠶 Nested Quantifiers
🠶 Rules of Inference
8
1. Propositional Logic
9
Section Summary
🠶 1 . 1 Propositions
🠶 1 . 2 Compound propositions
🠶 1.2.1 Negation
🠶 1.2.2 Connectives
Conjunction
Disjunction
Conditional statement/ Implication
New conditional statement: Contrapositive, Inverse,
Converse
Biconditionals
🠶 1 . 3 Truth Tables for Compound Propositions
10
1.1 Propositions
Definition: A proposition (denoted p, q, r, …) is simply:
🠶 a statement (i.e., a declarative sentence) with some definite meaning, (not vague or
ambiguous)
11
11 Examples for proposition
It is raining. (In a given situation)
12
11 Examples for Non-proposition
The following are NOT propositions:
13
12🠶 Constructing Propositions
🠶 Propositional Varia b les: p, q, r, s, …
🠶 The proposition tha t is always true is
de n o ted by T and the proposition that is
always false is deno ted by F.
14
1.2 Compound Propositions
An operator or connective combines one or more operand expressions into a larger expression.
(e.g., “+” in numeric expressions.)
🠶 Propositional or Boolean operators operate on propositions (or their truth values) instead of on
numbers.
🠶 The Boolean domain is the set {T, F}. Either of its elements is called a Boolean value.
15
131.2 Compound Propositions
🠶 C o m p o u n d Propositions; constructed from logical
connectives
a n d other propositions
16
1.2.1 Negation
p ¬p
T F
F T
17
1.2.2 Connectives
Conjunction
🠶 The conjunction of prop o sitions p a nd q is den ote d by p ∧ q
a nd ha s this truth table:
p q p∧q
T T T
T F F
F T F
F F F
18
Disjunction
🠶 The disjunction of propositions p a n d is d enote d by p
q ∨q
a n d has this truth table:
p q p ∨q
T T T
T F T
F T T
F F F
🠶 Example: If p denotes “I am a t ho me .” a n d q
denotes “It is raining.” then p ∨q denotes
🠶 “I am a t ho me or it is raining.”
19
The Connective Or in disjunction
🠶 In English “or” has two distinct meanings.
🠶 “Inclusive Or” - In the sentence “Students who have taken CS202 or
Math120 may take this class,” w e assume that students n e e d to have
taken one of the prerequisites, but may have taken both. This is the
meaning of disjunction. For p ∨q to b e true, either one or both of p
a n d q must b e true.
🠶 “Exclusive Or” - When reading the sentence “Soup or salad comes
with this entrée,” w e d o not expect to b e able to get both soup a n d
salad. This is the meaning of Exclusive Or (Xor). In p ⊕ q , one of p
a n d q must b e true, but not both. The truth table for ⊕ is:
p q p ⊕q
T T F
T F T
F T T
F F F
20
Conditional Statements: Implication
🠶 If p a n d q a re prop o sitions, the n p →q is a conditional statement or
implication which is read as “if p, then q ” a n d has this truth table:
p q p →q
T T T
T F F
F T T
F F T
21
Understanding Implication
22
Understanding Implication (cont)
23
Different Ways of Expressing p →q
if p, then q p implies
if p, q q p only if
q unless q
¬p q when p
q if p p is sufficient for
q q q is necessary
whenever for p
p
a necessary condition for p is
qqfollows
from p
a sufficient condition for q is p
24
New conditional statements: Converse,
Contrapositive, and Inverse
🠶 From p →q w e c a n form new conditional statements .
🠶 q →p is the converse of p →q
🠶 ¬q → ¬ p is the contrapositive of p →q
🠶 ¬p→¬q is the inverse of p →q
Example: Find the c onverse, inverse, and
con trapositive of “It’ s raining is a sufficient condition for my
not going to town.”
Solution:
converse:
?
inverse:
?
25
23Converse, Contrapositive, and Inverse
26
Biconditionals
27
Expressing the Biconditional
28
1.3 Truth Tables For Compound Propositions
🠶 Construction of a truth table:
🠶 Rows
🠶 Need a row for every possible for the
combination of values
atomic propositions.
🠶 Columns
🠶 N e e d a column for the c o m p o u n d proposition (usually at far
right)
🠶 N e e d a column for the truth value of e a c h expression that occurs
in the c o m p o u n d proposition as it is built up.
This includes the atomic propositions
29
That sounds
pretty
Example Truth Table easy.
30
28 Equivalent Propositions
🠶 Two propositions are equivalent if they always have the same truth
value.
🠶 Example: Show using a truth table that the conditional is equivalent
to the contrapositive.
Solution:
31
29 Equivalent Propositions
🠶 Two propositions are equivalent if they always have the same truth
value.
🠶 Example: Show using a truth table that the conditional is equivalent
to the contrapositive.
Solution:
p q ¬p ¬q p →q ¬q → ¬ p
T T F F T T
T F F T F F
F T T F T T
F F T T T T
32
Using a Truth Table to Show Non-Equivalence
Example: Show using truth tables that neither the converse nor inverse
of a n implication are not equivalent to the implication.
Solution:
p q ¬p ¬q p →q ¬ p →¬ q q→p
T T F F T T T
T F F T F T T
F T T F T F F
F F T T T T T
33
Precedence of Logical Operators
Operator Precedence
1
2
3
4
5
p q r is e qu iva le nt to (p q) r .
If the intend e d m eaning is p (q r ) then parentheses must b e used.
34
32 Exercise!
1. Which of these sentences are propositions? What are the truth values of those that are propositions?
a) 2 + 1 = 3
f) The re is no pollution in Kandy
g) 121 is a p e rfect squ are.
35
33
Exercise!(Cont)
36
Exercise!(Cont)
34
4. Let p and q be the propositions
p : It is below freezing.
q : It is snowing.
Write these propositions using p and q and logical connectives (including negations).
(p ∨ q) → (p ∧ q)
37
➼ Propositional Logic
➼ The Language of Propositions
➼ Applications
➼ Logical Equivalences
➼ Predicate Logic
➼ Predicates
➼ The Language of Quantifiers
➼ Nested Quantifiers
➼ Rules of Inference
1. Propositional
Logic
Section 3 – Logical
Equivalence
➼ Propositional Equivalence
Tautologies
Contradictions
Contingencies
Definition
De Morgan’s Laws
Key Logical Equivalence
Constructing new logical equivalences
Equivalence proof
➼ A tautology is a proposition which is always
true.
Example: p ∨¬p
P ¬p p ∨¬p p ⋀¬p
T F T F
F T T F
Definition:
p q ¬p ¬p ∨ q p→ q
T T F T T
T F F F F
F T T T T
F F T T T
De Morgan’s Laws
Augustus De Morgan
1806‐1871
p q ¬p ¬q (p∨q) ¬(p∨q) ¬p 𝖠 ¬q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
➼ Identity Laws: ,
➼ Domination Laws: ,
➼ Idempotent laws: ,
,
➼ Negation Laws:
➼
➼
Logical Equivalence Involving Logical Equivalence Involving
Conditional Statements Biconditional Statements
➼ We can show that two expressions are logically equivalent
by
developing a series of logically equivalent statements.
🠶 Propositional Logic
🠶 The Language of Propositions
🠶 Applications
🠶 Logical Equivalences
🠶 Predicate Logic
🠶 Predicates
🠶 The Language of Quantifiers
🠶 Nested Quantifiers
🠶 Rules of Inference
51
2. Predicate Logic
Predicates
7
52
Section Summary
🠶 Predicate Logic
Introduction
Propositional Functions
Universe of discourse
🠶 Quantifiers
Universal quantifier
Existential Quantifiers
Nested(Mixing) Quantifiers
53
Introduction
Consider the statements:
Theserelations may hold or not hold depending on the values that x, y, and z
may take.
A predicateis a property that is affirmed or denied about the subject (in logic,
we say ‘variable’ or ‘argument’) of a statement.
54
Propositional Functions
To write in Predicate Logic ‘x is greater than 3’
Terminology
◦P(x) is a statement
◦P is a predicate or propositional function
◦x as an argument
55
Propositional Functions (Cont)
Examples:
56
Propositional Functions (Cont)
Definition: A statement of the form is the value of the
propositional symbol P.
57
Propositional Functions (Cont)
Example: Let denote the statement .
Solution:
◦There are infinitely many values that make the proposition true.
(how many right triangles are there?)
58
Universe of Discourse
Consider the previous example. Does it make sense to assign to
x the value “blue”?
Intuitively,
the universe of discourse is the set of all things we
wish to talk about; that is, the set of all objects that we can
sensibly assign to a variable in a propositional function.
59
2. Predicate Logic
Language of Quantifiers
7
60
Quantifiers: Introduction
61
Universal Quantifier
Definition:
62
Universal Quantifier
Example I
Let
P(x): ‘x must take a discrete mathematics course’ and Q(x): ‘x is a
Computer Science(CS) student.’
The universe of discourse for both P(x) and Q(x) is all SLTC students.
Answer:
Shorthand:
64
Existential Quantifier
Definition:
65
Existential Quantifier
Example I
mean?
66
Existential Quantifier
Example 2
Express the statement: ‘there exists a real solution to .
Answer:
◦Where the universe of discourse for x is the set of real numbers. Note here
that a, b, c are fixed constants.
67
Existential Quantifier
Example 2(Cont)
What is the truth value of
Answer:
◦It is false. When , there are no real number that can satisfy the predicate.
Answer:
68
Quantifiers: Truth values
In general, when are quantified statements true or false?
69
Mixing(Nesting) quantifiers
Existentialand universal quantifiers can be used together to
quantify a propositional predicate.
For example:
is perfectly valid.
Note:
70
Mixing quantifiers
Example:
P(x,y) is true for every pair There is at least one pair x,y for
x,y which P(x,y) is false
Answer:
We want to express that for every pair of reals, , the following holds:
Answer:
Alternatively,
Mixing Quantifiers:
Example (3)
Express the multiplicative law for nonzero reals
Wewant to express that for every real number x, there exists a real
number y such that .
Answer:
𝑥 𝑦 ( 𝑥 𝑦 =1)
Mixing Quantifiers: Example 4
false mathematical statement
Does commutativity for subtraction hold over the reals?
•Answer:
• Let P(x,y) be the expression
• Let Q(x,y) be the expression
• The universe of discourse is (but not )
• Then the expression is:
Alternatively:
Chapter 01 Summary
🠶 Propositional Logic
🠶 The Language of Propositions
🠶 Applications
🠶 Logical Equivalences
🠶 Predicate Logic
🠶 Predicates
🠶 The Language of Quantifiers
🠶 Nested Quantifiers
🠶 Rules of Inference
78
2. Predicate Logic (Cont.)
79
Section Summary
🠶 Predicate Logic
Binding variables
Negation
80
Binding Variables
When a quantifier is used on a variable x, we say that x is bound.
If no quantifier is used on a variable in a predicate statement, the variable is called free.
Examples:
A statement is called a well-formed formula, when all variables are properly quantified.
Binding Variables: Scope
The set of all variables bound by a common quantifier is called the scope of the quantifier.
This is essentially the quantified version of De Morgan’s Law (when the universe of discourse
is finite, this is exactly De Morgan’s Law)
Truth Values of Negated Quantifiers
Answer:
🠶 Propositional Logic
🠶 The Language of Propositions
🠶 Applications
🠶 Logical Equivalences
🠶 Predicate Logic
🠶 Predicates
🠶 The Language of Quantifiers
🠶 Nested Quantifiers
🠶 Rules of Inference
88
3. Rules of Inference
89
Section Summary
🠶 Rules of Inference
Definition
Rules of inference chart.
Valid arguments
90
Rules of Inference
Definition
Therules of inference (also known as inference rules) are a logical
form or guide consisting of premises (or hypotheses) and draws a
conclusion.
There are two ways to form logical arguments, as seen in the image
below. We will be utilizing both formats in this lesson to become
familiar and comfortable with their framework.
91
Rules of Inference
.
92
Rules of Inference
.
.
.
93
Rules of Inference - chart
94
Rules of Inference – chart (Cont)
95
Modes Ponens
.
.
.
96
Modes Tollens
.
.
.
97
Hypothetical Syllogism
.
98
Disjunctive Syllogism
.
.
.
99
Addition
.
.
.
100
Simplification
.
101
Conjunction
102
Resolution
.
.
.
103
Building Valid Arguments
.
.
104
Valid Arguments
.
.
105
Valid Arguments
.
106
Solution
107
Solution(Cont..)
108
Chapter 01 Summary
🠶 Propositional Logic
🠶 The Language of Propositions
🠶 Applications
🠶 Logical Equivalences
🠶 Predicate Logic
🠶 Predicates
🠶 The Language of Quantifiers
🠶 Nested Quantifiers
🠶 Rules of Inference
109
Section Summary
🠶 Rules of Inference
Rules of Inference for Quantified Statements
110
Rules of Inference for Quantified
Statements
We have discussed rules of inference for propositions.
There
are types of quantifiers:
1.Universal Quantification (all, any, each, every)
2.Existential Quantification (there exists, some, at least one)
Wewill now describe some important rules of inference for statements involving
quantifiers.
111
Rules of Inference for Quantified
Statements
112
Example 1
Let
So, this means we are given to premises, and we want to know whether we
can conclude “some fierce creatures do not drink coffee.”
113
Example 1(Cont)
But the problem is, how do we conclude the last line of the argument from the two given assertions?
If we can prove this argument is true for one element, then we have shown that it is true for others.
Let’s let Lambert be our element. This means that Lambert is a lion who is fierce and doesn’t drink
coffee.
114
Example 1 (Cont)
115
Example 2
Show that the premises “Everyone in this discrete mathematics class has taken a course in
computer science” and “Marla is a student in this class” imply the conclusion “Marla has taken
a course in computer science”.
Solution
Let
denote “ is in this discrete mathematics class,” and let denote “ has taken a course in
computer science.” Then the premises are and The conclusion is
116
Example 2(Cont)
The following steps can be used to establish the conclusion from the premises
117