Professional Documents
Culture Documents
Discrete Mathematics S01 - S03
Discrete Mathematics S01 - S03
– Second level
• Third level
– Fourth level
» Fifth level
Discrete Mathematics
Session 1-3
Acknowledgement
• Click to editThese
Master text
slides have beenstyles
adapted from :
– Second level
• ThirdS.Epp.
Susanna level(2010). Discrete Mathematics with Applications.4th
edition. Thomson
– Fourth level Brooks/Cole. USA. ISBN: 9780534359454
» Fifth level
Chapter 2
Chapter 1
2
Learning Objectives
• Click toOnedit Master
successful text
completion styles
of this Course, students will be able to:
– Second level
LO1: Explain fundamental concepts of mathematical logic and
• Third level
proof
– Fourth level
LO2: Solve practical problems related to sets and counting
» Fifth level
LO3: Explain the concepts of function, relations and recursion
LO4 : Apply the concept of graphs and trees in real problems
LO 5 : Explain some applications of discrete mathematics in
computer science.
3
Logical Form and Logical
Equivalence
• Click to edit Master text styles
Logic is a science of the necessary laws of thought, without
– employment
which no Second levelof the understanding and the reason
• Third level takes place.
– Fourth level
—Immanuel Kant, 1785
» Fifth level
4
Outline
• Click
1
• to edit
Logical Master
Form text
and Logical styles
Equivalence
– Second
•
level
Conditional Statements
2 • Third level
– Fourth
• Valid level Arguments
and Invalid
3 » Fifth level
• Digital Logic Circuits
1
• Karnaugh Map
3
5
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
8
Conjunction
• Click to edit Master text styles
Definition
– Second level
If p and q are statementvariables, the conjunction of p
• Third level
and q is "p and q" denoted p q.
– Fourth level
» Fifth level
12
Logical Equivalence
•Definition
Click to edit Master text styles
Two– Second
statement level
forms are called
logically equivalent
• Third level If and only if,
they have–identical truth values for
Fourth level
each possible»substitution
Fifth level of
statements for their statement
variables. The logical equivalence
of statement forms P and Q is
denoted by writing P Q.
13
Example: Logical Equivalence
Distributivity: p (q r) (p
• Click to edit Master text styles q) (p r)
– Second level
p q r
• Thirdqlevel
r p (q r) pq pr (p q) (p r)
T T T– Fourth
T level T T T T
T T F »FFifth levelT T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F F T F F
F F T F F F T F
F F F F F F F F
14
Showing Nonequivalence
• Show that the statement forms ∼(p ∧ q) and ∼p ∧
•∼q
Click
are to
notedit Master
logically text styles
equivalent
– Second level
• Third level
– Fourth level
» Fifth level
15
Tautology and Contradiction
•Definition
Click to edit Master text styles
– Second level
A tautology is a statement
• Third
form that leveltrue.
is always
A statement– whose
Fourth level
form is
a tautology is a»tautological
Fifth level
statement.
17
Simplifying Statement Forms
Example : Use Theorem 2.1.1 to verify the logical
• Click to edit Master text styles
equivalence
– Second level∼(∼p ∧ q) ∧ (p ∨ q) ≡ p.
• Third level
Solution:
– Fourth level
» Fifth level
18
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
CONDITIONAL STATEMENTS
Conditional Statements
(Implication)
• Click to edit Master text styles
Definition
– Second level
• Third level
If p and q– are statement
Fourth level variables,
the conditional oflevel
» Fifth q by p is
"If p then q" or "p implies q" and is
denoted p → q. It is false when p is
true and q is false; otherwise it is
true.
20
The Negation of a Conditional
Statement
• Click to edit Master text styles
– Second level
• : Write
Example Third level
negations for each of the following statements:
a. If my car–isFourth
in thelevel
repair shop, then I cannot get to class.
» Fifth
b. If Sara lives in level then she lives in Greece.
Athens,
Solution :
a. My car is in the repair shop and I can get to class.
b. Sara lives in Athens and she does not live in Greece. (Sara
might live in Athens,
Georgia; Athens, Ohio; or Athens, Wisconsin.)
21
The Contrapositive, Converse and
Inverse of a Conditional Statement
• Click to edit Master text styles
– Second level
Definition
• Third level
Suppose–aFourth
conditional
level statement of the form “If p
then q” is given.
» Fifth level
1.The contrapositive is “If ~q then ~p” (~q → ~p)
2.The converse is “If q then p“ (q → p)
3.The inverse is "If ~p then ~q" (~p → ~q)
22
The Contrapositive, Converse and
Inverse of a Conditional Statement
• Click to edit Master text styles
Example : level
– Second
• Third level
Write each of the following statements in its equivalent
– Fourth level
contrapositive , Convers and Inverse form:
» Fifth level
a. If Howard can swim across the lake, then Howard can
swim to the island.
b. If today is Easter, then tomorrow is Monday.
23
The Contrapositive, Converse and
Inverse of a Conditional Statement
Solution
•a. Click to edit :Master
Contrapositive If Howardtext styles
cannot swim to the island, then
–Howard
Secondcannot
levelswim across the lake.
Converse:
• ThirdIflevel
Howard can swim to the island, then Howard
can swim acrosslevel
– Fourth the lake.
Inverse: If Howard cannot swim across the lake, then
» Fifth level
Howard cannot swim to the island.
b. Contrapositive : If tomorrow is not Monday, then today is
not Easter.
Converse: If tomorrow is Monday, then today is Easter.
Inverse: If today is not Easter, then tomorrow is not Monday
24
Biconditional (Biimplication)
• Click to edit Master text styles
Definition
– Second level
Given •statement
Third levelvariables p and q,
– Fourth level
the biconditional of p and q is "p if
» Fifth level
and only if q" and is denoted p ↔ q.
It is true if both p and q have the
same truth values and is false if p
and q have opposite truth values.
27
An Invalid Argument Form
•Show
Clickthat
tothe
edit Master
following text styles
argument form is invalid.
– Second level
• Third level
– Fourth level
» Fifth level
28
A Valid Argument Form
•Show
Click tothe
that edit Master
following text styles
argument form is valid
– Second level
• Third level
– Fourth level
» Fifth level
29
Rules of Inference
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
30
Application: A More
Complex Deduction
• are
You Click
abouttotoedit
leaveMaster
for school text
in the styles
morning and discover that
you don’t have your
– Second glasses. This statements are true:
level
a. If I was •reading the newspaper in the kitchen, then my glasses are
Third level
on the kitchen table.
– Fourth level
b. If my glasses are » on the kitchen table, then I saw them at
Fifth level
breakfast.
c. I did not see my glasses at breakfast.
d. I was reading the newspaper in the living room or I was reading
the newspaper in the kitchen.
e. If I was reading the newspaper in the living room then my glasses
are on the coffee table. Where are the glasses?
31
Application: A More Complex
Deduction
Solution :
•
Let Click to edit Master text styles
RK = I–was
Second level
reading the newspaper in the kitchen.
GK = My •glasses
Third level
are on the kitchen table.
– Fourth level
SB = I saw my glasses at breakfast.
» Fifth level
RL = I was reading the newspaper in the living room.
GC = My glasses are on the coffee table.
32
The conclusion
1. RK → GK by (a)
• GKClick
→ SB to edit Master text
by (d) styles
∴ RK → SB by transitivity
– Second level
2. RK → SB by the conclusion of (1) Thus the glasses are
• Third level
∼SB by (c)– on the coffee table.
Fourth level
∴ ∼RK by modus tollens
» Fifth level
3. RL ∨ RK by (d)
∼RK by the conclusion of (2)
∴ RL by elimination
4. RL → GC by (e)
RL by the conclusion of (3)
∴ GC by modus ponens
33
Exercises
Use symbols to write the logical form of each argument and
•then
Click
use atotruth
edittable
Master textargument
to test the styles for validity.
– Second level
a. If Tom is not on team A, then Hua is on team B.
•
If Hua Third
is notlevel
on team B, then Tom is on team A.
.'. Tom is–not
Fourth level
on team A or Hua is not on team B.
» Fifth level
b. Oleg is a math major or Oleg is an economics major.
If Oleg is a math major, then Oleg is required to take Math
362.
.'. Oleg is an economics major or Oleg is not required to take
Math 362.
34
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
36
Application: Digital Logic Circuits
37
Black Boxes and Gates
The operation of a black box is completely specified by
• Click to editanMaster
constructing text styles
input/output table that lists all its
– Second
possible input signals together with their corresponding
level
output signals.
• Third level
– Fourth level
» Fifth level
38
“NOT”, “AND”, and “OR” Gates
39
NAND and NOR Gates
40
Combinatorial Circuits
• Click to edit Master text styles
– Second level
In circuitry theory, NOT, AND, and OR gates are the
• Third level
basic gates. Any circuit can be designed using these
– Fourth level
gates. The circuits designed depend only on the inputs,
» Fifth level
not on the output. In other words, these circuits have
no memory. Also these circuits are called
combinatorial circuits.
41
Finding a Boolean Expression for a Circuit
Solution :
The final expression obtained, (P ∨ Q)∧ ∼(P ∧ Q), is
the expression for exclusive or: P or Q but not both.
42
Example 1: Boolean Expression
• Click to edit Master text styles
– Second level
• Third levelAB
– Fourth level =AB+C+D
» Fifth level
C+D
43
Example 2: Boolean Expression
• Click to edit Master text styles
– Second level A’
CD
44
Example 3: Boolean Expression
• Click to edit Master text styles
– Second level
AB
• Third level AB+B’
– Fourth level
B’
» Fifth level (AB+B’)BC
BC
45
Example 4: Boolean Expression
• Click to edit Master text styles
– Second level
A’
46
Recognizer
•Definition
Click to edit Master text styles
A recognizer is a circuit that outputs a 1 for exactly one
– Second level
particular combination of input signals and outputs 0’s for
• Third level
all other combinations.
–
Fourth level
» Fifth level
47
Constructing Circuits for Boolean
Expressions
• Click to edit Master text styles
Construct
– Secondcircuits
levelfor the following Boolean expressions
• Third level
– Fourth level
Solution : » Fifth level
a multiple-input AND-gate
48
The Circuit Corresponding
to a Boolean Expression
• Click to edit Master text styles
– following
The Second example
level shows how to construct a circuit
corresponding to a Boolean expression.
• Third level
– Fourth level
» Fifth level
49
The Circuit Corresponding
to a Boolean Expression
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
50
Designing a Circuit for a
Given Input/Output Table
Design a circuit for the following input/output table:
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
Solution :
(P ∧ Q ∧ R) ∨ (P∧ ∼Q ∧ R) ∨ (P∧ ∼Q∧ ∼R).
51
Disjunctive Normal Form
• Click to edit Master (DNF)
text styles
Definition
– Second level
Disjunctive Normal Form (DNF) is a boolean expression E,
• Third level
which has no duplication on the multiplication of each
– Fourth level
variable
» Fifth level
Example
E1 = X Z’ + X’ Y Z’ + X Y’ Z is DNF
Example
1.Let P1 = xy’zp and P2 = xyt, then consensus of P1 and
P2 is Q = xzpt
2.Let P1 = xy’z and P2 = x’yzp, then P1 and P2 don’t
have consensus because P1 and P2 have two
complement variable, they are x and y. 54
Theorem of Fundamental
• Click to edit MasterProduct
text styles
– Second
Theorem level
(Include)
If fundamental
• Third levelproduct P2 including fundamental product
P1, then– Fourth level
» Fifth level P1+P2=P1
Example :
xz xyz xz
55
• Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
Karnaugh Map
Karnaugh Map
•A Karnaugh
Click to Map
editisMaster
a grid-liketext styles of a truth table.
representation
It is–really
Secondjustlevel
another way of presenting a truth table, but
the mode of level
• Third presentation gives more insight. A Karnaugh
map has zero andlevel
– Fourth one entries at different positions. Each
position in a grid corresponds
» Fifth level to a truth table entry.
Given a Boolean function described by a truth table or logic
function, then:
• Draw the Karnaugh Mapfor the function.
• Use the information from a Karnaugh Map to determine
the smallest sum-of-products function.
57
Karnaugh Map
Two Variables
•LetClick to edit Master text styles
(x,y,) be a sum of product Boolean expression such
– minterm
that Second level
consists of three variables x,y. To define the
K-map•for (x,y)
Third level, we consider the following examples.
– Fourth level
Example: » Fifth level
The left picture is the K-map corresponding to the
(x,y) = xy + x’y + x’y’
The left picture is the K-map corresponding to the
(x,y) = x’y + xy’
58
Karnaugh Map
• Click to edit Master text styles
Let (x,y,z) be a sum of product Boolean expression such
– Second level
that minterm consists of three variables x,y,z. To define
• Third level
the K-map for (x,y,z) , we consider the following table
– Fourth level
» Fifth level
59
Karnaugh Map
• Click to edit Master text styles
Let–(x,y,z,w) be a sum
Second level
of product Boolean
• Third level
expression such that
– Fourth level
minterm consists of
» Fifth level
three variables x,y,z,w.
To define the K-map
for (x,y,z,w), we
consider the following
table
60
Literal Karnaugh Map
• Click to edit Master text styles
1. Pairs
– Second level
• Third level
– Fourth level
» Fifth level
or
61
Literal Karnaugh Map
•2.Click to edit
Horizontal Master text styles
Quads
– Second level
• Third level
– Fourth level
» Fifth level
Karnaugh map above same as following Karnaugh Map
62
Literal Karnaugh Map
•3. Click toQuads
Vertical edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
Karnaugh map above same as following Karnaugh Map
63
Literal Karnaugh Map
•4.Click
Octetsto(1/2)
edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
Karnaugh map above same as following Karnaugh Map
64
Literal Karnaugh Map
•4. Click
Octets to edit Master text styles
(2/2)
Karnaugh
– Secondmap in slide before same as following Karnaugh
level
Map
• Third level
– Fourth level
» Fifth level
65
Literal Karnaugh Map
• Overlapping
5. Click to edit Master text styles
– Second level
• Third level
– Fourth level
» Fifth level
isolated
68