Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

DISCRETE MATHEMATICS

An Open Introduction

BY OSCAR LEVIN

BOOK REVIEW BY:


QASIM LAKDAWALA
19BT04020
BTECH COMPUTER SCIENCE

WHAT IS DISCRETE MATHEMATICS?


Discrete Mathematics deals with the study of Mathematical structures. It
deals with objects that can have distinct separate values. It is also called
Decision Mathematics or finite Mathematics. It is the study of mathematical
structures that are fundamentally discrete in nature and it does not require the
notion of continuity.
Objects that are studied in discrete mathematics are largely countable sets
such as formal languages, integers, finite graphs, and so on. Due to its
application in Computer Science, it has become popular in recent decades. It
is used in programming languages, software development, cryptography,
algorithms etc. Discrete Mathematics covers some important concepts such
as set theory, graph theory, logic, permutation and combination as well. In this
article, let us discuss these important concepts in detail.
SYMBOLIC LOGIC AND PROOF
Logic is the study of consequence. Given a few mathematical statements or
facts, we would like to be able to draw some conclusions. Whenever we find
an “answer” in math, we really have a (perhaps hidden) argument.
Mathematics is really about proving general statements (like the Intermediate
Value Theorem), and this too is done via an argument, usually called a proof.
We start with some given conditions, the premises of our argument, and from
these we find a consequence of interest, our conclusion.

ARGUMENTS
An argument is a set of statements, one of which is called the

conclusion and the rest of which are called premises. An argument

is said to be valid if the conclusion must be true whenever the

premises are all true. An argument is invalid if it is not valid; it

is possible for all the premises to be true and the conclusion to be


false.

EXAMPLE

If Edith eats her vegetables, then she can have a cookie.

Edith eats her vegetables.

Edith gets a cookie.

Florence must eat her vegetables in order to get a cookie.

Florence eats her vegetables.

Florence gets a cookie.

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.

True or false? We will answer this question, and won’t need to


know

anything about Monopoly. Instead we will look at the logical form


of the

statement.

We need to decide when the statement (P → Q) ∨ (Q → R) is true.

Using the definitions of the connectives in Section 0.2, we see that


for this

to be true, either P → Q must be true or Q → R must be true (or


both).

Those are true if either P is false or Q is true (in the first case) and
Q is false

or R is true (in the second case). So—yeah, it gets kind of messy.


Luckily,

we can make a chart to keep track of all the possibilities. Enter


truth

tables. The idea is this: on each row, we list a possible


combination of T’s

and F’s (for true and false) for each of the sentential variables,
and then

mark down whether the statement in question is true or false in


that case.

We do this for every possible combination of T’s and F’s. Then we


can
clearly see in which cases the statement is true or false. For
complicated

statements, we will first fill in values for each part of the


statement, as a

way of breaking up our task into smaller, more manageable


pieces.

Since the truth value of a statement is completely determined by


the

truth values of its parts and how they are connected, all you really
need

to know is the truth tables for each of the logical connectives.


Here they

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

The truth table for negation looks like this:

PP

TF

FT

None of these truth tables should come as a surprise; they are all
just

restating the definitions of the connectives. Let’s try another one.

 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.

Some examples of Propositions are given below −

 "Man is Mortal", it returns truth value “TRUE”


 "12 + 9 = 3 – 2", it returns truth value “FALSE”
The following is not a Proposition −
"A is less than 2". It is because unless we give a specific
value of A, we cannot say whether the statement is true or
false.
n propositional logic generally we use five connectives
which are −

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

A Contradiction is a formula which is always false for every value


of its propositional variables.
Example − Prove (A∨B)∧[(¬A)∧(¬B)](A∨B)∧[(¬A)∧(¬B)] is a
contradiction
The truth table is as follows −
A B A∨ ¬A ¬B (¬ A) (A ∨
B ∧ ( ¬ B) ∧
B) [( ¬
A) ∧
(¬ B)]

True True True False Fals False False


e
True False True False True False False
Fals True True True Fals False False
e e
Fals False False True True True False
e
As we can see every value of (A∨B)∧[(¬A)∧(¬B)]
(A∨B)∧[(¬A)∧(¬B)] is “False”, it is a contradiction.

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.


¬(P ∨ Q) is logically equivalent to ¬P ∧ ¬Q.

This suggests there might be a sort of


“algebra” you could apply to
statements (okay, there is: it is called Boolean
algebra) to transform one
statement into another. We can start collecting
useful examples of logical
equivalence, and apply them in succession to
a statement, instead of
writing out a complicated truth table.
De Morgan’s laws do not do not directly help
us with implications,
but as we saw above, every implication can be
written as a disjunction:

IMPLICATIONS ARE DISJUNCTIONS

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.

While we don’t have logical equivalence, it is


the case that when-
ever (P ∨ Q) → R is true, so is (P → R) ∨ (Q
→ R). This tells us

that we can deduce (P → R) ∨ (Q → R) from


(P ∨ Q) → R, just not
the reverse direction.

GRAPH THEORY

Elements of Graph Theory

Graphs, Paths, and Circuits


An undirected graph G consists of a set VG of
vertices and a set EG of edges such that each edge
e ∈ EG is associated with an unordered pair of
vertices, called its endpoints. A directed graph or
digraph G consists of a set VG of vertices and a
set EG of edges such that each edge e ∈ EG is
associated with an ordered pair of vertices. We
denote a graph by G = (VG, EG). Two vertices are
said to be adjacent if there is an edge connecting
the two vertices. Two edges associated to the same
vertices are called parallel. An edge incident to a
single vertex is called a loop. A vertex that is
not incident on any edge is called an isolated
vertex. A graph with neither loops nor parallel
edges is called a simple graph.

EXAMPLE

a. Find EG and VG.


b. List the isolated vertices.
c. List the loops.
d. List the parallel edges.
e. List the vertices adjacent to v3..
f. Find all edges incident on v4.
Solution.
a. EG = {e1, e2, e3, e4, e5, e6} and VG = {v1, v2, v3, v4, v5, v6, v7}.
b. There is only one isolated vertex, v5.
c. There is only one loop, e5.
d. {e2, e3}.
e. {v2, v4}.
f. {e1, e4, e5}

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

Show that the graph G is bipartite.


Show that K3 is not bipartite.

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|

This completes a proof of the theorem


In an undirected graph G a sequence P of the form v0e1v1e2 · · · vnn 1envn
with no edge repeated is called a path of length n or a path connecting v0
to vn. If P is a path such that v0 = vn then it is called a circuit or a cycle.
A path or circuit is simple if it does not contain the same vertex more than
once. A graph that does not contain any circuit is called acyclic.
Theorem 34.3
If a graph G has an Euler circuit then every vertex of the graph has even
degree.
Proof.
Let G be a graph with an Euler circuit. Start at some vertex on the circuit
and follow the circuit from vertex to vertex, erasing each edge as you go
along it. When you go through a vertex you erase one edge going in and one
edge going out, or else you erase a loop. Either way, the erasure reduces the
degree of the vertex by 2. Eventually every edge gets erased and all the ver
tices have degree 0. So all vertices must have had even degree to begin with.
It follows from the above theorem that if a graph has a vertex with odd
degree then the graph can not have an Euler circuit.
The following provides a converse to the above theorem.
Theorem 34.4 (Euler Theorem)
If all the vertices of a connected graph have even degree, then the graph has
an Euler circuit

EXAMPLE

Show that the following graph has no Euler circuit.


Solution.
Vertices v1 and v3 both have degree 3, which is odd. Hence, by the remark
following the previous theorem, this graph does not have an Euler circuit.
A path is called a Hamiltonian path if it visits every vertex of the graph
exactly once. A circuit that visits every vertex exactly once except for the
last vertex which duplicates the fifirst one is called a Hamiltonian circuit.

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.

You might also like