CompDiscMathNotes
CompDiscMathNotes
CompDiscMathNotes
1
Example. Fibonacci’s rabbits satisfy
2
Example. Call a string of symbols a valid arithmetic expres-
sion if
3
First method of proof
Theorem 2.2.2. (The Principal of Mathematical Induction)
Let P (n) be a statement about the positive integers. If one
can prove that
4
Definition: A permutation is an ordered arrangement of dis-
tinct objects.
n!
P (n, r) = .
(n − r)!
5
A probability experiment is an experiment that can be
carried out under repeatable conditions with a set of outcomes
that are equally likely to occur. The sample space of the
experiment is the set of all possible outcomes, and a subset of
the sample space is called an event.
6
Pascal’s Triangle:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1 Blaise Pascal (1623-1662)
Source: Wickimedia Commons
1 7 21 35 35 21 7 1
...
7
An earlier source is the Yáng Huī (ca. 1238 - 1298) triangle
below. So in China it is known as the Yáng Huī Triangle.
8
Vandermonde’s Identity. Let m, n, and r be nonnegative
integers with r not exceeding either m or n. Then
r
X
C(m + n, r) = C(m, r − k)C(n, k)
k=0
= C(m, r)C(n, 0) + C(m, r − 1)C(n, 1)
+ · · · + C(m, 0)C(n, r)
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
...
21 = 6 · 1 + 4 · 3 + 1 · 3
9
The Binomial Theorem. The coefficient of the an−k bk
term in the expansion of (a + b)n is C(n, k), i.e.
n
X
(a + b)n = C(n, k)an−k bk
k=0
= a + C(n, 1)an−1b + C(n, 2)an−2b2 + C(n, 3)an−3b3 + · · · + bn
n
To expand (a + b)n:
10
Question? Suppose that a baseball player has a batting aver-
age of .300 and comes to the plate five times in a game. What
is the probability that he gets three hits? Or that he gets at
least three hits?
One-to-one correspondences
11
Question? How many integer solutions to
x1 + x2 + x3 + x4 + x5 = 16
12
Now that we have conquered counting solutions in-
volving non-negative integers, how about the case
of positive integers?
13
We have seen one generating function in that we
“generated” C(n, r) as the coefficient of xr in the
expansion of (1 + x)n. For instance,
(1 + x)7 = x7 + 7 x6 + 21 x5 + 35 x4 + 35 x3 + 21 x2 + 7 x + 1
14
Back to Pascal’s Triangle:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
.
.
.
16
Derangements
A derangement of a set of items with a natural order
is a permutation of them such that none of the items
is in its natural position.
Question? How many derangements of a set of n
items are there?
17
The possibilities are that k goes to position 1, or it
doesn’t.
Case 1: k goes to position 1. Then the other n − 2
integers are deranged among themselves and this
can be done in Dn−2 ways.
Case 2: k does not go to position 1. With the posi-
tion of 1 known, each of the other integers has one
restriction on where it can move: Each integer i
other than k cannot go to position i and integer
k cannot go to position 1. This is equivalent to de-
ranging the n − 1 integers other than 1 and can be
done in Dn−1 ways.
Hence, x = Dn−1 + Dn−2 and Dn = (n − 1)(Dn−1 + Dn−2).
Some sources use the notation !n for the number
of derangements. Then here is the formula that we
derived:
0 if n = 1,
!n = Dn = 1 if n = 2, and
(n − 1)(Dn−1 + Dn−2) if n > 2
18
The derangements of {1, 2, 3, 4} grouped by the lo-
cation of 1:
2 1 4 3
3 1 4 2
4 1 2 3
3 4 1 2
2 4 1 3
4 3 1 2
4 3 2 1
2 3 4 1
3 4 2 1
19
Here are the derangements of {1, 2, 3, 4, 5} where 1
goes to position 2:
There are D3 = 2 where 1 and 2 change places:
2 1 4 5 3
2 1 5 3 4
4 1 2 5 3
4 1 5 3 2
4 1 5 2 3
3 1 2 5 4
3 1 4 5 2
3 1 5 2 4
5 1 2 3 4
5 1 4 2 3
5 1 4 3 2
20
There is an interesting relationship between facto-
rials and derangements. Note that the plot below
uses !n for the number of derangements.
21
The Excel spreadsheet below shows that the ratio
of the number of derangements to the number of
1
permutations approaches .
e
22
Closed forms for recursions
23
Fibonacci numbers and Phi
The nautilus, the logarithmic spiral, and additive
squares
24
Pea tendrils, additive triangles, and the logarithmic
spiral
Source:
easyweb.easynet.co.uk/ iany/patterns/spirals.htm
25
The Golden Rectangle in Art and Architecture
Seurat Turner
Parthenon Parthenon
26
To pique your interest, here is a relationship be-
tween Fibonacci numbers and binomial coefficients:
= C(n − i, i)
i=0
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
...
27
Getting ready for fun with Fibonacci
To prepare for things to come regarding Fibonacci
numbers, here is an alternate way to define them:
Let fn count the number of ways for an n by 1
board to be covered by a combination of squares
and dominoes. A square covers one square of the
board, and a domino covers two squares. We start
to count with the empty board which can be covered
in one way, i.e. f0 = 1. The one board can be
covered by a square in one way so that f1 = 1. For
n ≥ 2, fn = fn−1 + fn−2.
The five coverings of a 4-board are illustrated below:
28
Combinatorial fun with Fibonacci
Proposition. For n ≥ 0,
F2n−1 = C(n, 1)F0 + C(n, 2)F1 + · · · + C(n, k)Fk−1 + · · · + C(n, n)Fn−1
n
X n
= Fk−1
k
k=1
2
Proposition. For n ≥ 1, Fn2 + Fn+1 = F2n+2.
2n
X 2n
Proposition. F2i−1 = 5nF2n−1.
i=0
i
2n+1
X
2n + 1 2
Proposition. Fi−1 = 5nF2n.
i=0
i
29
The Towers of Hanoi
In the great temple of Brahma in Benares, India,
on a brass plate under the dome that marks the
center of the world, there are 64 disks of pure gold
that the priests carry one at a time between three
diamond needles according to Brahma’s immutable
law: No disk may be placed on a smaller disk. In
the beginning of the world all 64 disks formed the
Tower of Brahma on one needle. Now, however,
the process of transfer of the tower from one needle
to another is in mid course. When the last disk
is finally in place, once again forming the Tower of
Brahma but on a different needle, then will come
the end of the world and all will turn to dust.
30
A bit of logic
To prove a proposition like “If P , then Q”, abbre-
viated “P ⇒ Q” there are two options: prove the
proposition directly, or prove the logically equiva-
lent contrapositive of the proposition ¬Q ⇒ ¬P .
In the second method, called proof by contradiction,
one assumes that Q is false and shows that that
assumption leads to a contradiction of P .
31
Problem. Prove that, given any 12 distinct natural
numbers, we can choose two of them such that their
difference is divisible by 11.
32
Modular arithmetic
a ≡ b (mod m)
whenever m|(a − b). If m 6 |(a − b), we write a 6≡ b
(mod m).
33
Proposition. Let m be a fixed integer. Let a, b, and
c be integers. Then
(i) a + b ≡ a0 + b0 (mod m)
(ii) a − b ≡ a0 − b0 (mod m)
(iii) a · b ≡ a0 · b0 (mod m)
34
Example. Note that 28 ≡ 10 (mod 6). Also, 2 divides
both 28 and 10 so we might expect to divide by 2
and have 14 be equivalent to 5 modulo 6.
But 14 6≡ 5 (mod 6).
What happened? Why can’t we“cancel” the 2 in
this case?
35
So we can cancel a constant in a modular equiva-
lence only when the constant and the modulus are
relatively prime.
36
Introduction to Graph Theory
A graph is a set of vertices and a set of edges such
that each edge is associated with an (unordered)
pair of vertices.
37
The Konigsberg Bridge Problem
The river Pregel flows through Konigsberg, and in
Euler’s day there were seven bridges connecting the
North and South shores and the two islands in the
river. A popular puzzle in the town was whether or
not it was possible to walk in such a way as to cross
each bridge exactly once.
The Bridges of Konigsberg
Leonhard
Euler (1707 – 1783)
38
A graph is planar if it can be drawn in the plane
without its edges crossing.
Utilities Puzzle
Connect all of the circles with all of the squares
without arcs crossing.
40
Question? So who cares if a graph is planar, or at
least, close to planar?
41
Question? Can there exist a hydrocarbon with five
carbon atoms and three hydrogen atoms?
Two hydrocarbons
H
•
..
...
..
...
...
...
...
...
...
...
....
METHANE
H• .....................................................
•
...
.....................................................
•H CH4
...
...
...
C
...
...
...
...
...
...
...
...
• H H
H •
...
...
• ...
...
... ...
... ...
... ...
... ...
... ...
... ...
ETHYLENE ...
...
... .....................................
............
... .............. ........
.......
...
...
...
...
• ...
•C
..
C
C 2 H4 ... .........
...
...
...
........
.............
....................................
..
.......
........
...
...
...
...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
•
H
•
H
42
Question? (The Party Problem.) Six guests are
invited to a party, and each pair of guests are ei-
ther friends or strangers. Is it true that among the
guests there are always three who are all friends or
three who are all strangers?
43
Just how hard are these problems? Here is a quote
from Paul Erdös:
“Imagine an alien force, vastly more powerful than
us landing on Earth and demanding the value of
R(5, 5) or they will destroy our planet. In that case,
we should marshal all our computers and all our
mathematicians and attempt to find the value. But
suppose, instead, that they asked for R(6, 6), we
should attempt to destroy the aliens.”
44
So here is a problem likely not so hard, just “...
difficult and is not likely to be solvable by an ama-
teur.”
Unsolved problem. (The 3n + 1 Problem)
In this problem, a sequence is generated starting
with an initial natural number n. The rule for gen-
erating the next natural number in the sequence
is; if n is even, the next natural number in the
sequence is n/2, or if n is odd, the next natural
number in the sequence is 3n + 1. For example, if
the initial value of n is 17, the sequence generated
is {17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, . . .}. If the
natural number 4 is encountered in the sequence,
the sequence starts repeating ({4, 2, 1} is generated
over and over). There are three possibilities;
rell Cox.
45
Instant Insanity
Four blocks have their faces colored red, white, green
and blue. The problem is to stack the blocks so that
all four colors show on each side of the stack.
Trees
A tree is a graph with a unique path joining any
pair of vertices.
46
Counting “words”
Question? Using the 26 letters of the alphabet
and considering the letters AEIOUY to be vow-
els and the others consonants, how many five letter
“words”, i.e., five letter lists, are there subject to
the following constraints?
47
In a graph, a component is a maximal connected
subgraph. Two vertices are in the same connected
component if and only if there exists a path between
them
Two useful facts:
Lemma. Removing an edge that belongs to a circuit
of a connected graph does not disconnect the graph.
(a.) T is a tree.
(b.) T is connected and contains no cycles.
(c.) T is connected and has n − 1 edges.
(d.) T contains no cycles and has n − 1 edges.
48
A weighted graph is a graph with lengths assigned
to the edges, e.g., distances, times, costs, etc.
49
Prim’s algorithm
We assume that G is a weighted, connected graph
without loops or parallel edges and having n ver-
tices. Let Tk be the tree formed by the algorithm
at step k.
50
Theorem. Prim’s algorithm is correct.
Proof. We must show that the algorithm actually
produces a minimal spanning tree. Letting Ti be the
tree formed by the algorithm at step i, we proceed
by induction.
51
Theorem. The number of edges examined in execut-
ing Prim’s algorithm is at worst a cubic polynomial
of the number of edges.
n(n + 1)(2n + 1)
12 + 22 + · · · + n2 =
6
An application
A symmetric function of several variables is one in
which an exchange of variables does not alter the
value of the function.
Interesting property. A minimal spanning tree min-
imizes an increasing symmetric function of the edge
lengths.
Question? A message is to be passed to all mem-
bers of an underground organization. Each member
knows certain other members and has a means of
contacting them. Associated with each contact i
to j is a probability pij that the message will be
compromised.
Assuming that these probabilities are independent,
how should a message be distributed to minimize
the overall chance of compromise?
52
The Dual of a Graph and The Four Color Theorem
The dual G0 of a planar graph G is the graph ob-
tained by placing a vertex of G0 in each face of G
and connecting the vertices of G0 if the correspond-
ing faces of G share an edge.
53
cases needed to be colored and used a computer for
a case-by-case analysis of those cases.
Theorem. (Four Color Theorem) Any planar graph
can be colored by four colors.
54
A bit of perfection
An integer n is perfect if it is the sum of its positive
divisors other than itself.
http://www.mersenne.org/
55
Three unsolved problems:
Unsolved problem. Are there infinitely many Mersenne
primes?
56
A little about prime numbers and their distribution
Theorem. (Euclid) There are infinitely many primes.
Theorem. There are arbitrarily large gaps between
successive primes.
Proof. Can be done in one line!
57
Attitudes toward infinity at the time of Cantor
Expressions like this basic limit
1
lim =0
n→∞ n
Cantor’s Theorem(s):
Theorem 1. The set of integers has the same size
as the set of even integers.
This result caused Cantor to define a set as infinite if
could be placed in one-to-one correspondence with
one of its proper subsets.
59
Theorem 2. The set of rational numbers has the
same size as the set of natural numbers.
Proof. Establish a one-to-one correspondence be-
tween the representations of the rational numbers
and the natural numbers as below:
n Rational representations
1 1 1 1 1 1
1 1 2 3 4 5 6 ···
2 2 2 2 2
3 1 2 3 4 5
3 3 3 3
6 1 2 3 4
10 4 4 4 ...
1 2 3
5 5
15 1 2
6
21 1
... ...
61
Another method of proof
smallest integer without a prime factorization and a and b are smaller, then
which is a contradiction.
62
Peano’s Axioms for Arithmetic
The following axioms were developed by Guiseppe
Peano (1858-1932) as the culmination of his effort to
formalize arithmetic. They are included here only
because they are referenced in the next major the-
orem.
1. 1 is a natural number.
2. For every natural number x there exists another
natural number x0 called the successor of x.
3. 1 6= x0 for every natural number x (x0 being the
successor of x).
4. If x0 = y 0 then x = y.
5. If Q is a property such that:
(a) If 1 has the property Q, and
(b) if x has property Q then x0 has property Q,
then property Q holds for all natural numbers.
63
Kurt Gödel
(1906 – 1978)
Gödel’s Incompleteness Theorem.
In any consistent formal mathemati-
cal system that is expressive enough
to state Peano’s Axioms for arith-
metic, there is a statement that is
true but not provable.
Source:
https://en.wikipedia.org/wiki/Kurt Gödel
64
Problems potpourri
Proposition.
1 · C(n, 1) + 2 · C(n, 2) + 3 · C(n, 3) + · · · + n · C(n, n) = n2n−1.
n n−2 n−2 n−2
Proposition. = +2 + .
k k k−1 k−2
1 1 1 1 1
Proposition. + 2 + 3 + · · · + k = 1 − k.
2 2 2 2 2
67
Remarks on Calculus and Discrete Mathematics
Disclaimers. Given the time constraints, the defini-
tions, etc., are a bit casual. Being a discrete course,
limits are, of course, avoided.
The derivative of a function f is the rate of change
of the function, or geometrically, the slope of the
tangent line to the graph of the function. If the
derivative of a function f exists for every point
in an interval it defines a function on the interval
whose value at x is denoted by f 0(x).
The process of obtaining a derivative is called dif-
ferentiation.
A substantial part of early calculus involves cal-
culating the derivatives of functions built up from
combinations of other functions. In other words,
differentiation is recursive.
One such rule is the product rule:
d d d
(u(x)v(x)) = u(x) (v(x)) + (u(x)) v(x)
dx dx dx
There are of course rules for the differentiation of
specific functions:
d n
v For n other than 0, (x ) = nxn−1
dx
d
v (sin(x)) = cos(x)
dx
68
d
v (cos(x)) = − sin(x)
dx
69
Calculus Points to Ponder
70
u a divergent infinite series whose nth term ap-
proaches 0.
X Appreciate the beauty of the connections with
science, e.g.,
u Fermat’s Principle implies Snell’s Law,
u The percentage increase in the flux through
an artery is four times the increase in the
radius.
X Pay attention to how the Mean Value Theorem
can be applied in the development of the meth-
ods of locating maxima and minima. You can
ignore it in many courses, but there are MANY
applications of the Mean Value Theorem later
in analysis, so learn it now!
X Don’t ignore Riemann Sums and the definition
of the definite integral just because the Funda-
mental Theorem of Calculus seems so much eas-
ier. It may happen that the functions that turn
out to be important to you don’t show up in con-
venient closed form with a nice neat antideriva-
tive.
X Watch for the analogy between the solution of
the closed form of the Fibonacci numbers and
the solution of an initial value problem involving
a second order linear differential equation with
constant coefficients.
71
Selected references:
72