Professional Documents
Culture Documents
Discrete Mathematics Assignments
Discrete Mathematics Assignments
An Open Introduction
BY OSCAR LEVIN
ARGUMENTS
An argument is a set of statements, one of which is called the
EXAMPLE
TRUTH TABLES
Here’s a question about playing Monopoly:
If you get more doubles than any other player then you will
lose, or if you lose then you must have bought the most prop-
erties.
statement.
Those are true if either P is false or Q is true (in the first case) and
Q is false
and F’s (for true and false) for each of the sentential variables,
and then
truth values of its parts and how they are connected, all you really
need
are:
PQP∧Q
TTT
TFF
FTF
FFF
PQP∨Q
TTT
TFT
FTT
FFF
PQP→Q
TTT
TFF
FTT
FFT
PQP↔Q
TTT
TFF
FTF
FFT
PP
TF
FT
None of these truth tables should come as a surprise; they are all
just
EXAMPLE
Make a truth table for the statement ¬P ∨ Q.
Solution. Note that this statement is not ¬(P ∨ Q), the negation
belongs to P alone. Here is the truth table:
P Q ¬P ¬P ∨ Q
TTFT
TFFF
FTTT
FFTT
We added a column for ¬P to make filling out the last column
easier. The entries in the ¬P column were determined by the entries
in the P column. Then to fill in the final column, look only at the
column for Q and the column for ¬P and use the rule for ∨.
PROPOSITIONAL LOGIC
A proposition is a collection of declarative statements that has either
a truth value "true” or a truth value "false". A propositional consists of
propositional variables and connectives. We denote the
propositional variables by capital letters (A, B, etc). The connectives
connect the propositional variables.
1)OR (∨∨)
2)AND (∧∧)
3)Negation/ NOT (¬¬)
4)Implication / if-then (→→)
5)If and only if (⇔⇔).
TAUTOLOGIES
A Tautology is a formula which is always true for every value of its
propositional variables.
Example − Prove [(A→B)∧A]→B[(A→B)∧A]→B is a tautology
The truth table is as follows −
A B A→ (A → B) [( A → B ) ∧
B ∧A A] → B
True True True True True
True False False False True
Fals True True False True
e
Fals False True False True
e
As we can see every value of [(A→B)∧A]→B[(A→B)∧A]→B is
"True", it is a tautology.
Contradictions
Contingency
A Contingency is a formula which has both some true and some
false values for every value of its propositional variables.
Example − Prove (A∨B)∧(¬A)(A∨B)∧(¬A) a contingency
The truth table is as follows −
A B A∨B ¬A (A ∨ B) ∧ (¬ A)
True True True False False
True False True False False
False True True True True
False False False True False
As we can see every value of (A∨B)∧(¬A)(A∨B)∧(¬A) has both
“True” and “False”, it is a contingency.
DE MORGANS LAW
P → Q is logically equivalent to ¬P ∨ Q.
Example: “If a number is a multiple of 4, then it
is even” is
equivalent to, “a number is not a multiple of 4
or (else) it is even.”
EXAMPLES
Are the statements (P ∨ Q) → R and (P → R)
∨ (Q → R) logically
equivalent?
Solution. Note that while we could start
rewriting these statements
with logically equivalent replacements in the
hopes of transforming
one into another, we will never be sure that
our failure is due to
their lack of logical equivalence rather than our
lack of imagination.
So instead, let’s make a truth table:
P Q R (P ∨ Q) → R (P → R) ∨ (Q → R)
TTTTT
TTFFF
TFTTT
TFFFT
FTTTT
FTFFT
FFTTT
FFFTT
Look at the fourth (or sixth) row. In this case,(P
→ R)∨(Q → R)
is true, but (P ∨ Q) → R is false. Therefore the
statements are not
logically equivalent.
GRAPH THEORY
EXAMPLE
EXAMPLE
Which one of the following graphs is simple
Solution.
a. G is not simple since it has a loop and parallel edges.
b. G is simple.
A complete graph on n vertices, denoted by Kn, is the simple graph that
contains exactly one edge between each pair of distinct vertices.
EXAMPLE
Solution.
a. Clear from the defifinition and the graph.
b. Any two sets of vertices of K3 will have one set with at least two vertices.
Thus, according to the defifinition of bipartite graph, K3 is not bipartite.
A complete bipartite graph Km,n, is the graph that has its vertex set
partitioned into two disjoint subsets of m and n vertices, respectively. More-
over, there is an edge between two vertices if and only if one vertex is in the
fifirst set and the other vertex is in the second set.
Theorem 34.1
For any graph G = (VG, EG) we have
2|EG| = X
v∈V (G)
deg(v).
Proof.
Suppose that VG = {v1, v2, · · · , vn} and |EG| = m. Let e ∈ EG. If e is a loop
then it contributes 2 to the total degree of G. If e is not a loop then let vi and
vj denote the endpoints of e. Then e contributes 1 to deg(vi) and contributes
1 to the deg(vj ). Therefore, e contributes 2 to the total degree of G. Since e
was chosen arbitrarily, this shows that each edge of G contributes 2 to the
total degree of G. Thus,
2|EG| = X
v∈V (G)
deg(v)
The following is easily deduced from the previous theorem.
Theorem 34.2
In any graph there are an even number of vertices of odd degree.
Proof.
Let G = (VG, EG) be a graph. By the previous theorem, the sum of all the
degrees of the vertices is T = 2|EG|, an even number. Let E be the sum of
the numbers deg(v), each which is even and O the sum of numbers deg(v)
each which is odd. Then T = E + O. That is, O = T T E. Since both T and
E are even, O is also even. This implies that there must be an even number
of the odd degrees. Hence, there must be an even number of vertices with
odd degree.
EXAMPLE
Find a formula for the number of edges in Kn.
Solution.
Since G is complete, each vertex is adjacent to the remaining vertices. Thus,
the degree of each of the n vertices is n n 1, and we have the sum of the de
grees of all of the vertices being n(nn1). By Theorem 34.1, n(nn1) = 2|EG|
EXAMPLE
EXAMPLE
Show that the following graph has a Hamiltonian path but no Hamiltonian
circuit.
Solution.
vwxyz is a Hamiltonian path. There is no Hamiltonian circuit since no cycle
goes through v.
Trees
An undirected graph is called a tree if each pair of distinct vertices has
exactly one path between them. Thus, a tree has no parallel edges and no
loops.
We next show a result that is needed for the proof of our fifirst main theorem
of trees.
Theorem 35.1
Any tree with more than one vertex has one vertex of degree 1.
Proof.
Let T be a tree with a number of vertices ≥ 1. Pick a vertex v at random
and search outward from v on a path along edges from one vertex to another
looking for a vertex of degree one. As each new vertex is reached, check
whether it has degree 1. If so, a vertex of degree 1 has been found. If not, it
is possible to exit from the new vertex along a difffferent edge from that used
to reach the vertex. Because T is a tree, it is circuit-free, and so the path
never returns to a previously used vertex. Since the number of vertices of
T is fifinite, the process of building a path must eventually terminate. When
that happens, the fifinal vertex of the path must have degree 1
The following is the fifirst of the two main theorems about trees:
Theorem 35.2
A tree with n vertices has exactly n n 1 edges.
Proof.
The proof is by induction on n ≥ 1. Let P(n) be the property: Any tree with
n vertices has n n 1 edges.
Basis of induction: P(1) is valid since a tree with one vertex has zero edges.
Induction hypothesis: Suppose that P(n) holds up to n ≥ 1.
Induction Step: We must show that any tree with n + 1 vertices has n
edges. Indeed, let T be any tree with n + 1 vertices. Since n + 1 ≥ 2, by the
previous theorem, T has a vertex v of degree 1. Let T0 be the graph obtained
by removing v and the edge attached to v. Then T0 is a tree with n vertices.
By the induction hypothesis, T0 has n n 1 edges and so T has n edges
Theorem 35.3
Any connected graph with n vertices and n n 1 edges is a tree.
A rooted tree is a tree in which a particular vertex is designated as the
root. The level of a vertex v is the length of the simple path from the
root to v. The height of a rooted tree is the maximum level number that
occurs.
EXAMPLE
Find the level of each vertex and the height of the following rooted tree.
Solution.
v1 is the root of the given tree.
vertex level
v2
1
v3
1
v4
2
v5
2
v6
2
v7
2
The height of the tree is 2.
Let T be a rooted tree with root v0. Suppose (v0, v1, · · · , vn) is a simple
path in T and x, y, z are three vertices. Then
(a) vnn 1 is the parent of vn.
(b) v0, v1, · · · , vnn 1 are the ancestors of vn.
(c) vn is the child of vnn 1.
(d) If x is an ancestor of y then y is a descendant of x.
(e) If x and y are children of z then x and y are siblings.
(f) If x has no children, then x is a leaf.
(g) The subtree of T rooted at x is the graph with vertex set V and edge
set E, where V is x together with the descendants of x and
E = {e|e is an edge on a simple path from x to some vertex in V }
SUMMARY OF BOOK
This course serves
both as an introduction to topics in discrete math
and as the “introduction to proof” course
for math majors. The course is usually taught with
a large amount of student inquiry, and
this text is written to help facilitate this.
Four main topics are covered: counting,
sequences, logic, and graph theory. Along the
way proofs are introduced, including proofs by
contradiction, proofs by induction, and
combinatorial proofs. The book contains over 470
exercises, including 275 with solutions
and another 100 or so with hints. Exercises range
from elementary to quite challenging.
While there are many fine discrete math textbooks
available, this text has the following
advantages:
– It is written to be used in an inquiry rich course.
– It is written to be used in a course for future
math teachers.
– It is open source, with low cost print editions and
free electronic editions.