You are on page 1of 17

Lecture Notes in Discrete Mathematics

Marcel B. Finan
Arkansas Tech University
All
c Rights Reserved
2
Preface

This book is designed for a one semester course in discrete mathematics


for sophomore or junior level students. The text covers the mathematical
concepts that students will encounter in many disciplines such as computer
science, engineering, Business, and the sciences.
Besides reading the book, students are strongly encouraged to do all the
excercises. Mathematics is a discipline in which working the problems is es-
sential to the understanding of the material contained in this book. Students
are encouraged first to do the problems without referring to the solutions.
Solutions to problems found at the end of this book can only be used when
you are stuck. Exert a reasonable amount of efforts towards solving a prob-
lem before you look up the answer, and rework any problem you miss.
Students are strongly encouraged to keep up with the exercises and the se-
quel of concepts as they are going along, for mathematics builds on itself.
Solution Manual for the text can be requested from the author through
email:mfinan@atu.edu

Marcel B. Finan
May 2001

3
4 PREFACE
Contents

Preface 3

Fundamentals of Mathematical Logic 7


1 Propositions and Related Concepts . . . . . . . . . . . . . . . . . 8
2 Conditional and Biconditional Propositions . . . . . . . . . . . . 18
3 Rules of Inferential Logic . . . . . . . . . . . . . . . . . . . . . . . 24
4 Propositions and Quantifiers . . . . . . . . . . . . . . . . . . . . . 33
5 Arguments with Quantified Premises . . . . . . . . . . . . . . . . 41
6 Project I: Digital Logic Design . . . . . . . . . . . . . . . . . . . 45
7 Project II: Number Systems . . . . . . . . . . . . . . . . . . . . . 50

Fundamentals of Mathematical Proofs 53


8 Methods of Direct Proof I . . . . . . . . . . . . . . . . . . . . . . 53
9 More Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . 59
10 Methods of Indirect Proofs: Contradiction and Contraposition . 64
11 Method of Proof by Induction . . . . . . . . . . . . . . . . . . . 67
12 Project III: Elementary Number Theory and Mathematical Proofs 74
13 Project IV: The Euclidean Algorithm . . . . . . . . . . . . . . . 76
14 Project V: Induction and the Algebra of Matrices . . . . . . . . 78

Fundamentals of Set Theory 81


15 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
16 Properties of Sets . . . . . . . . . . . . . . . . . . . . . . . . . . 90
17 Project VI: Boolean Algebra . . . . . . . . . . . . . . . . . . . . 98

Relations and Functions 99


18 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . 99
19 Partial Order Relations . . . . . . . . . . . . . . . . . . . . . . . 110

5
6 CONTENTS

20 Functions: Definitions and Examples . . . . . . . . . . . . . . . 116


21 Bijective and Inverse Functions . . . . . . . . . . . . . . . . . . . 124
22 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
23 Project VII: Applications to Relations . . . . . . . . . . . . . . . 145
24 Project VIII: Well-Ordered Sets and Lattices . . . . . . . . . . . 148
25 Project IX: The Pigeonhole Principle . . . . . . . . . . . . . . . 149
26 Project X: Countable Sets . . . . . . . . . . . . . . . . . . . . . 150
27 Project XI: Finite-State Automaton . . . . . . . . . . . . . . . . 152

Introduction to the Analysis of Algorithms 157


28 Time Complexity and O-Notation . . . . . . . . . . . . . . . . . 157
29 Logarithmic and Exponential Complexities . . . . . . . . . . . . 165
30 Θ- and Ω-Notations . . . . . . . . . . . . . . . . . . . . . . . . . 169

Fundamentals of Counting and Probability Theory 173


31 Elements of Counting . . . . . . . . . . . . . . . . . . . . . . . . 173
32 Basic Probability Terms and Rules . . . . . . . . . . . . . . . . . 180
33 Binomial Random Variables . . . . . . . . . . . . . . . . . . . . 191

Elements of Graph Theory 197


34 Graphs, Paths, and Circuits . . . . . . . . . . . . . . . . . . . . 197
35 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Fundamentals of Mathematical
Logic

Logic is commonly known as the science of reasoning. The emphasis here


will be on logic as a working tool. We will develop some of the symbolic
techniques required for computer logic. Some of the reasons to study logic
are the following:

• At the hardware level the design of ’logic’ circuits to implement in-


structions is greatly simplified by the use of symbolic logic.

• At the software level a knowledge of symbolic logic is helpful in the


design of programs.

7
8 FUNDAMENTALS OF MATHEMATICAL LOGIC

1 Propositions and Related Concepts


A proposition is any meaningful statement that is either true or false, but
not both. We will use lowercase letters, such as p, q, r, · · · , to represent
propositions. We will also use the notation

p:1+1=3

to define p to be the proposition 1 + 1 = 3. The truth value of a proposition


is true, denoted by T, if it is a true statement and false, denoted by F, if it
is a false statement. Statements that are not propositions include questions
and commands.

Example 1.1
Which of the following are propositions? Give the truth value of the propo-
sitions.
a. 2 + 3 = 7.
b. Julius Ceasar was president of the United States.
c. What time is it?
d. Be quiet !

Solution.
a. A proposition with truth value (F).
b. A proposition wiht truth value (F).
c. Not a proposition since no truth value can be assigned to this statement.
d. Not a proposition

Example 1.2
Which of the following are propositions? Give the truth value of the propo-
sitions.
a. The difference of two primes.
b. 2 + 2 = 4.
c. Washington D.C. is the capital of New York.
d. How are you?

Solution.
a. Not a proposition.
b. A proposition with truth value (T).
c. A proposition with truth value (F).
1 PROPOSITIONS AND RELATED CONCEPTS 9

d. Not a proposition

New propositions called compound propositions or propositional func-


tions can be obtained from old ones by using symbolic connectives which
we discuss next. The propositions that form a propositional function are
called the propositional variables.
Let p and q be propositions. The conjunction of p and q, denoted p ∧ q, is
the proposition: p and q. This proposition is defined to be true only when
both p and q are true and it is false otherwise. The disjunction of p and
q, denoted p ∨ q, is the proposition: p or q. The ’or’ is used in an inclusive
way. This proposition is false only when both p and q are false, otherwise it
is true.

Example 1.3
Let

p: 5<9
q : 9 < 7.

Construct the propositions p ∧ q and p ∨ q.

Solution.
The conjunction of the propositions p and q is the proposition

p ∧ q : 5 < 9 and 9 < 7.

The disjunction of the propositions p and q is the proposition

p ∨ q : 5 < 9 or 9 < 7

Example 1.4
Consider the following propositions

p: It is Friday
q: It is raining.

Construct the propositions p ∧ q and p ∨ q.


10 FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
The conjunction of the propositions p and q is the proposition

p ∧ q : It is F riday and it is raining.

The disjunction of the propositions p and q is the proposition

p ∨ q : It is F riday or It is raining

A truth table displays the relationships between the truth values of propo-
sitions. Next, we display the truth tables of p ∧ q and p ∨ q.
p q p∧q
T T T
T F F
F T F
F F F

p q p∨q
T T T
T F T
F T T
F F F

Let p and q be two propositions. The exclusive or of p and q, denoted p ⊕ q,


is the proposition that is true when exactly one of p and q is true and is false
otherwise. The truth table of the exclusive ’or’ is displayed below
p q p⊕q
T T F
T F T
F T T
F F F

Example 1.5
a. Construct a truth table for (p ⊕ q) ⊕ r.
b. Construct a truth table for p ⊕ p.

Solution.
a.
1 PROPOSITIONS AND RELATED CONCEPTS 11

p q r p⊕q (p ⊕ q) ⊕ r
T T T F T
T T F F F
T F T T F
T F F T T
F T T T F
F T F T T
F F T F T
F F F F F

b.
p p⊕p
T F
F F

The final operation on a proposition p that we discuss is the negation of p.


The negation of p, denoted ∼ p, is the proposition not p. The truth table of
∼ p is displayed below
p ∼p
T F
F T

Example 1.6
Consider the following propositions:
p: Today is Thursday.
q: 2 + 1 = 3.
r: There is no pollution in New Jersey.

Construct the truth table of [∼ (p ∧ q)] ∨ r.

Solution.

p q r p ∧q ∼ (p ∧ q) [∼ (p ∧ q)] ∨ r
T T T T F T
T T F T F F
F T T F T T
F T F F T T
12 FUNDAMENTALS OF MATHEMATICAL LOGIC

Example 1.7
Find the negation of the proposition p : −5 < x ≤ 0.

Solution.
The negation of p is the proposition ∼ p : x > 0 or x ≤ −5

A compound proposition is called a tautology if it is always true, regardless


of the truth values of the basic propositions which comprise it.

Example 1.8
a. Construct the truth table of the proposition (p∧q)∨(∼ p∨ ∼ q). Determine
if this proposition is a tautology.
b. Show that p∨ ∼ p is a tautology.

Solution.
a.
p q ∼p ∼q ∼ p∨ ∼ q p∧q (p ∧ q) ∨ (∼ p∧ ∼ q)
T T F F F T T
T F F T T F T
F T T F T F T
F F T T T F T

Thus, the given proposition is a tautology.


b.
p ∼p p∨ ∼ p
T F T
F T T

Again, this proposition is a tautology.

Two propositions are equivalent if they have exactly the same truth values
under all circumstances. We write p ≡ q.

Example 1.9
a. Show that ∼ (p ∨ q) ≡∼ p∧ ∼ q.
b. Show that ∼ (p ∧ q) ≡∼ p∨ ∼ q.
c. Show that ∼ (∼ p) ≡ p.
a. and b. are known as DeMorgan’s laws.
1 PROPOSITIONS AND RELATED CONCEPTS 13

Solution.
a.
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
b.
p q ∼p ∼q p∧q ∼ (p ∧ q) ∼ p∨ ∼ q
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T
c.
p ∼p ∼ (∼ p)
T F T
F T F

Example 1.10
a. Show that p ∧ q ≡ q ∧ p and p ∨ q ≡ q ∨ p.
b. Show that (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) and (p ∧ q) ∧ r ≡ p ∧ (q ∧ r).
c. Show that (p ∧ q) ∨ r ≡ (p ∨ r) ∧ (q ∨ r) and (p ∨ q) ∧ r ≡ (p ∧ r) ∨ (q ∧ r).

Solution.
a.
p q p∧q q∧p
T T T T
T F F F
F T F F
F F F F

p q p∨q q∨p
T T T T
T F T T
F T T T
F F F F
14 FUNDAMENTALS OF MATHEMATICAL LOGIC

b.

p q r p∨q q∨r (p ∨ q) ∨ r p ∨ (q ∨ r)
T T T T T T T
T T F T T T T
T F T T T T T
T F F T F T T
F T T T T T T
F T F T T T T
F F T F T T T
F F F F F F F

p q r p∧q q∧r (p ∧ q) ∧ r p ∧ (q ∧ r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F T F F
F T F F F F F
F F T F F F F
F F F F F F F

c.

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


T T T T T T T T
T T F T T T T T
T F T F T T T T
T F F F T F F F
F T T F T T T T
F T F F F T F F
F F T F T T T T
F F F F F F F F
1 PROPOSITIONS AND RELATED CONCEPTS 15

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


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

Example 1.11
Show that ∼ (p ∧ q) 6≡∼ p∧ ∼ q

Solution.
We will use truth tables to prove the claim.
p q ∼p ∼q p∧q ∼ (p ∧ q) ∼ p∧ ∼ q
T T F F T F F
T F F T F T 6 = F
F T T F F T 6 = F
F F T T F T T

A compound proposition that has the value F for all possible values of the
propositions in it is called a contradiction.

Example 1.12
Show that the proposition p∧ ∼ p is a contradiction.

Solution.

p ∼p p∧ ∼ p
T F F
F T F

In propositional functions, the order of operations is that ∼ is performed


first. The operations ∨ and ∧ are executed in any order.
16 FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 1.1
Indicate which of the following sentences are propositions.
a. 1,024 is the smallest four-digit number that is perfect square.
b. She is a mathematics major.
c. 128 = 26
d. x = 26 .

Problem 1.2
Consider the propositions:
p: Juan is a math major.
q: Juan is a computer science major.

Use symbolic connectives to represent the proposition ”Juan is a math major


but not a computer science major.”

Problem 1.3
In the following sentence is the word ”or” used in its inclusive or exclusive
sense? ”A team wins the playoffs if it wins two games in a row or a total of
three games.”

Problem 1.4
Write the truth table for the proposition: (p ∨ (∼ p ∨ q))∧ ∼ (q∧ ∼ r).

Problem 1.5
Let t be a tautology. Show that p ∨ t ≡ t.

Problem 1.6
Let c be a contradiction. Show that p ∨ c ≡ p.

Problem 1.7
Show that (r ∨ p) ∧ [(∼ r ∨ (p ∧ q)) ∧ (r ∨ q)] ≡ p ∧ q.

Problem 1.8
Use De Morgan’s laws to write the negation for the proposition:”This com-
puter program has a logical error in the first ten lines or it is being run with
an incomplete data set.”
1 PROPOSITIONS AND RELATED CONCEPTS 17

Problem 1.9
Use De Morgan’s laws to write the negation for the proposition:”The dollar
is at an all-time high and the stock market is at a record low.”

Problem 1.10
Assume x ∈ IR. Use De Morgan’s laws to write the negation for the proposition:0 ≥
x > −5.

Problem 1.11
Show that the proposition s = (p ∧ q) ∨ (∼ p ∨ (p∧ ∼ q)) is a tautology.

Problem 1.12
Show that the proposition s = (p∧ ∼ q) ∧ (∼ p ∨ q) is a contradiction.

Problem 1.13
a. Find simpler proposition forms that are logically equivalent to p ⊕ p and
p ⊕ (p ⊕ p).
b. Is (p ⊕ q) ⊕ r ≡ p ⊕ (q ⊕ r)? Justify your answer.
c. Is (p ⊕ q) ∧ r ≡ (p ∧ r) ⊕ (q ∧ r)? Justify your answer.

Problem 1.14
Show the following:
a. p ∧ t ≡ p, where t is a tautology.
b. p ∧ c ≡ c, where c is a contradiction.
c. ∼ t ≡ c and ∼ c ≡ t.
d. p ∨ p ≡ p and p ∧ p ≡ p.

You might also like