You are on page 1of 55

Philosophical Issues

• Mathematical induction has nothing to do with


induction in the physical and empirical sciences.
– Sun rises on Monday, on Tuesday, etc., so it must rise
every day from now?a
• Mathematical induction is merely a defining property of
integers.
– It is deductive.
• So it is either a definition or provable based on other
fundamental axioms!
a David Hume (1748), “That the sun will not rise tomorrow is no less
intelligible a proposition, and implies no more contradiction than the
affirmation, that it will rise.”

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 212
Compositions of Positive Integers Revisited
• Recall that a composition for m is a sum of positive
integers whose order is relevant and which sum to m.a
• Next we use mathematical induction to reprove the
number of compositions for m is 2m−1 .
• The statement clearly holds when m = 1.
• So assume it holds for general m and now consider the
compositions of m + 1.
a Recall p. 102.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 213
The Proof (continued)
• Suppose the last summand is some n > 1.
– Replace the last summand by n − 1.
– The result is a composition of m:

m+1 = ···+ n

m = · · · + (n − 1).

– This correspondence is one-to-one (why?).


– So there are 2m−1 compositions in this case.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 214
The Proof (concluded)
• Now suppose the last summand is 1.
– Remove the last summand.
– The result is a composition of m.
– This correspondence is also one-to-one (why?).
– So there are 2m−1 compositions in this case.
• The total number of compositions of m + 1 is hence

2m−1 + 2m−1 = 2m .

• This is consistent with Theorem 19 (p. 103).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 215
Do You Really Need Induction?
• In the proof that the total number of compositions of m
is 2m−1 , induction was used.
• Can we do away with it by, say, an indirect proof?
• So we set out to obtain a contradiction by assuming the
desired number is not 2m−1 .
• What next?

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 216
Do You Really Need Induction? (concluded)
• It is typical to work on the smallest m such that the
desired number does not equal 2m−1 .
• This m cannot be 1 by inspection.
• But if m > 1, we obtain another contradiction because
...
• This proof relies, if surreptitiously, on the well-ordering
principle (p. 203)!
• But we knew that principle is equivalent to
mathematical induction (p. 209).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 217
Identities for Summations
Theorem 36 For n ∈ Z+ ,
n
 n
2
2
n (n + 1) 2  
= i3 = i .
4 i=1 i=1

• The identities are clearly true when n = 1.


• Assume the identities are true for n = k.
• Let us work on the first identity first.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 218
The Proof (continued)
• By induction,

(k + 1)2 (k + 2)2
4
k 2 (k + 1)2
= + (k + 1)3
4
 k 

= i3 + (k + 1)3
i=1
k+1

= i3 .
i=1

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 219
The Proof (concluded)
• As for the second identity,
k+1 2  k 2  k 
  
i = i + 2(k + 1) i + (k + 1)2
i=1 i=1 i=1
 k 2
 k(k + 1)
= i + 2(k + 1) + (k + 1)2
i=1
2
 k 2

= i + (k + 1)3
i=1
 k  k+1
 
3 3
= i + (k + 1) = i3 .
i=1 i=1

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 220
Fibonaccia Numbers (1202)
• Let F0 = 0 and F1 = 1.
• Let Fn = Fn−1 + Fn−2 for n ≥ 2.b
– F2 = 0 + 1 = 1.
– F3 = 1 + 1 = 2.
– F4 = 1 + 2 = 3.
• Innumerable applications in surprisingly diverse fields.
a Leonardo Fibonacci (1175–1250).
b This is called a recursive definition; useful when it is simpler or when

an explicit formula is unavailable.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 221
Leonardo Fibonacci (1175–1250)

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 222
An Identity for Fibonacci Numbers
n a
Theorem 37 i=0 F i = F n+2 − 1 for n ∈ N.
• For n = 0, F0 = 0 = 1 − 1 = F2 − 1.
• Inductively,
k+1
 k

 
Fi = Fi + Fk+1
i=0 i=0
= Fk+2 − 1 + Fk+1
= Fk+3 − 1.
a Recall F0 = 0 and F1 = 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 223
Another Identity for Fibonacci Numbers
n 2 + a
Theorem 38 F
i=0 i = F n F n+1 for n ∈ Z .
• For n = 1, F02 + F12 = 1 = F1 F2 .
• Inductively,
k+1

Fi2
i=0
 k


= Fi2 2
+ Fk+1 2
= Fk Fk+1 + Fk+1
i=0
= Fk+1 (Fk + Fk+1 ) = Fk+1 Fk+2 .
a Recall F0 = 0 and F1 = 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 224
Mathematical Induction: Second Form
Theorem 39 Let S(n) denote an (open) mathematical
statement containing references to a positive integer n. Also
let n0 , n1 ∈ Z+ with n0 ≤ n1 . Suppose
• S(n0 ), S(n0 + 1), . . . , S(n1 ) are true and
• S(k + 1) is true whenever S(n0 ), S(n1 ), . . . , S(k) are
true for arbitrarily chosen positive integer k ≥ n1 .
Then S(n) is true for all positive integers n ≥ n0 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 225
An Inequality for the Fibonacci Numbersa
Fn < 2n , n ≥ 0.
• The inequality holds for F0 = 0 and F1 = 1.
• Suppose Fk < 2k for all k ≤ n and n ≥ 1.
• Then, for n ≥ 1,

Fn+1 = Fn + Fn−1 < 2n + 2n−1 < 2n + 2n = 2n+1 .


a Recall F0 = 0 and F1 = 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 226
Fundamental Integer Arithmetics
• b | a means that b divides a, where a, b ∈ Z and b = 0.
– b is a divisor or factor of a; a is a multiple of b.
• If a, b ∈ Z with b > 0, then there exist unique q, r ∈ Z
such that
a = qb + r,
where 0 ≤ r < b.
• gcd(a, b) > 0 denotes the greatest common divisor of
 0.a
a, b ∈ Z, where a = 0 or b =
• Recall that a prime is a positive integer larger than 1
whose only divisors are itself and 1.
a The convention is gcd(a, 0) = gcd(0, a) = | a |.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 227
d(n): Number of Positive Divisors
Theorem 40 Let n = pe11 pe22 · · · pet t be the prime
factorization of n. Then the number of positive divisors of n
equals
d(n) = (e1 + 1)(e2 + 1) · · · (et + 1).
• A positive divisor of n is of form

n = ps11 ps22 · · · pst t ,

where 0 ≤ si ≤ ei .
• There are e1 + 1 choices for s1 , e2 + 1 choices for s2 , etc.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 228
Cardinality
• For any set A, define | A | as A’s cardinality (size).
• Two sets A and B are said to have the same cardinality
(written as | A | = | B | or A ∼ B) if there exists a
one-to-one correspondencea between their elements.
• For example, | { a, b, c } | = | { 1, 2, 3 } | becauseb

a ↔ 1,
b ↔ 2,
c ↔ 3.
a Tobe defined precisely on p. 303.
b Thanks to a lively class discussion on March 22, 2018.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 229
Cardinality (concluded)
• 2A denotes set A’s power set, that is { B : B ⊆ A }.
• For example, if A = { a, b, c }, then

2A = { ∅, { a }, { b }, { c }, { a, b }, { a, c }, { b, c }, { a, b, c } }.

• If | A | = k, then
| 2A | = 2k .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 230
A Combinatorial Proof for k < 2k by Pascal (1557)
• Let
A = { 1, 2, . . . , k }
be a set with k elements.
• | 2A | = 2k .
• But
k
 
2A = { { 1 }, { 2 }, . . . , { k }, { 1, 2 }, . . . , { 1, 2, . . . , k }, ∅ }.

• Hence k < | 2A | = 2k (the whole is greater than a proper


part).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 231
What If | A | Is Infinite?
• When A is an infinite set, | A | < | 2A |, too.
• This is the famous theorem of Cantor (1895).
• His argument can be used to show the existence of
uncomputable problems.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 232
Georg Cantor (1845–1918)

Kac and Ulam (1968), “[If] one


had to name a single person
whose work has had the most
decisive influence on the present
spirit of mathematics, it would
almost surely be Georg Cantor.”

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 233
Relations and Functions

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 234
It is unworthy of excellent men
to lose hours like slaves
in the labor of computation.
— Gottfried Wilhelm von Leibniz (1646–1716)

I thought perhaps you might be members of


that lowly section of the university
known as the Sheffield Scientific School.
F. Scott Fitzgerald (1920), “May Day”

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 235
Cartesian Products
• Let A and B be two sets.
• The Cartesian product of A and B is
Δ
A × B = {(a, b) : a ∈ A, b ∈ B}.

• If | A | = m and | B | = n, then

| A × B | = m × n.

• In general,
Δ
A1 × A2 × · · · × Ak = {(a1 , a2 , . . . , ak ) : a1 ∈ A1 , . . .},
k
Δ
 
k
A = A × A × ··· × A.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 236
Relationsa
• A subset of A × B is called a relation from A to B.
– A relation can be ∅.
• A subset of A × A is called a binary relation on A.
– { (a, b) : a < b, where a, b, ∈ Z } ⊆ Z × Z.
– { (a, b) : b = a2 , where a, b, ∈ Z } ⊆ Z × Z.
a Peirce (1870).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 237
Relations (concluded)
• If | A | = m and | B | = n, then there are

2mn (26)

relations from A to B.
– Each one of the mn 2-tuples (a, b) ∈ A × B can be
either in the relation or not.
– Alternative proof: | A × B | = mn, so there are 2mn
subsets of A × B.a
a Equivalently, | 2A×B | = 2mn .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 238
A B
a

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 239
Functionsa
• Let A, B be nonempty sets.
• A function (mapping) f from A to B is denoted by

f : A → B.

– A is the domain of f .
– B is the codomain of f .
a Leibniz (1692).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 240
Functions (concluded)
• A function is a relation from A to B in which f (a) is
associated with a unique b ∈ B, written as f (a) = b.
– b is the image of a under f .
– a is a preimage of b.
• The image of set C under f is
Δ
f (C) = { f (a) : a ∈ C }.

• f (A) is the range of f .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 241
Number of Functions
If | A | = m and | B | = n, then there are

| B || A | = nm (27)

functions from A to B.
• For each a in the domain A, there are n choices of b in
the codomain B to make f (a) = b.
• There are m choices of a ∈ A.
• Hence the desired number is
m
 
n × n × · · · × n = nm .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 242
A B
a

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 243
Number of Booleana Functions
• A boolean function maps { 0, 1 }m to { 0, 1 }.
– For example,

f (x1 , x2 ) = x1 ∧ x2

is a boolean function from { 0, 1 }2 to { 0, 1 }.


• There are
m
2(2 )
(28)
boolean functions.
– Eq. (27) on p. 242 with | A | = 2m and | B | = 2.
– Alternative proof: The truth table has 2m rows, and
each row has a function value of 0 or 1.
a George Boole (1815–1864).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 244
Partial Functions
• A partial function is like a function except that there
are elements in its domain for which it is undefined.
– f (x) = 1/x is not defined when x = 0.
• Formally, a partial function f : A → B is a function
from some A to B:
– A = ∅ and A  A.
– f (x) is defined for x ∈ A .
– f (x) is not defined for x ∈ A − A .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 245
Number of Partial Functions
If | A | = m and | B | = n, then there are

m−1
m i
n
i=1
i

partial functions from A to B.


m
• There are i ways to choose an A  A of size
1 ≤ i ≤ m − 1.
• For each such A , there are ni functions from A to B by
Eq. (27) on p. 242.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 246
Number of Partial Functions (concluded)a
• The number of partial functions can be simplified thus:


m−1
m i
n
i=1
i



m 0 m m
= (1 + n)m − n − n
0 m
= (1 + n)m − 1 − nm .

• How to interpret this alternative formula?b


a Contributed by Mr. Ricky Sheng-Chieh Kao (B06902117) on March
22, 2018.  
b The convention m = 1 for m ≥ 0 on p. 26 works very well above.
0

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 247
Monotone Increasing Functions
A function f : { 1, 2, . . . , m } → { 1, 2, . . . , n } is monotone
increasing if

f (i) ≤ f (j) whenever i < j.


m+n−1
Theorem 41 There are m monotone increasing
functions from { 1, 2, . . . , m } to { 1, 2, . . . , n }.
• Extend monotone increasing function f with f (0) = 1
and f (m + 1) = n as “guards.”
– f is a monotone increasing function if and only if the
extended f is.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 248
The Proof (continued)
• There are m + 1 increments:
Δ
xi = f (i) − f (i − 1), 1 ≤ i ≤ m + 1.

• They must all be nonnegative.


• We also know the total increment is fixed,a at

x1 + x2 + · · · + xm+1 = f (m + 1) − f (0) = n − 1.
a Recall pp. 90ff for a similar idea.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 249
The Proof (continued)

f(i)
n
n- f(m)

f(m)- f(m- 1)

2
0 0

0 m

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 250
The Proof (continued)
• Each such function corresponds to a solution with

xi = f (i) − f (i − 1), i = 1, 2, . . . , m + 1

and vice versa (why?).


– For m = 3 and n = 6, the equation to solve is
x1 + x2 + x3 + x4 = 5.
– The solution x1 = 2, x2 = 0, x3 = 1, x4 = 2
corresponds to

f (0) = 1, f (1) = f (0) + 2 = 3,


f (2) = f (1) + 0 = 3, f (3) = f (2) + 1 = 4,
f (4) = f (3) + 2 = 6.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 251
The Proof (concluded)
• So the goal is the number of nonnegative integer
solutions of

x1 + x2 + · · · + xm+1 = n − 1.

• By p. 85, the desired count is






(m + 1) + (n − 1) − 1 m+n−1 m+n−1
= = .
n−1 n−1 m

• When m = n, the number is




2n − 1
.
n

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 252
An Example: Monotone Increasing Functions
• Take m = 4 and n = 3.
4+3−1
• The formula says there are 4 = 15 monotone
increasing functions from { 1, 2, 3, 4 } to { 1, 2, 3 }.
Valid (f (1), f (2), f (3), f (4)) values
1,1,1,1 1,1,1,2 1,1,1,3 1,1,2,2
1,1,2,3 1,1,3,3 1,2,2,2 1,2,2,3
1,2,3,3 1,3,3,3 2,2,2,2 2,2,2,3
2,2,3,3 2,3,3,3 3,3,3,3

• The number of monotone boolean functions is called the


Dedekind number.a
a Dedekind (1897).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 253
Monotone Increasing Functions with f (x) ≤ x
Theorem 42 There are


1 2n
bn =
n+1 n
monotone increasing functions
f : { 1, 2, . . . , n } → { 1, 2, . . . , n } that satisfy f (x) ≤ x.
• Clearly, f (1) = 1; the starting point is already fixed.
• Extend each such function f with f (n + 1) = n + 1.
• That fixes the ending point.
• Draw a line from (1, 1) to (n + 1, n + 1).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 254
f(i)
n+1
+1
f(x)=x +1
-1

-1
+1
-1
+1

+1
-1 -1

0 n+1

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 255
The Proof (concluded)
• Each valid function corresponds to a permutation of
n n
   
−1, −1, . . . , −1, +1, +1, . . . , +1

with nonnegative prefix sums (p. 127).a


• Alternatively, it is the number of binomial random walks
without touching the negative territory in 2n steps
(pp. 117ff).
a Think of “−1” as right move and “+1” as up move.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 256
An Example: Monotone Increasing Functions with
f (x) ≤ x
• Take n = 4.

1 8
• There are 5 4 = 14 monotone increasing functions
f : { 1, 2, 3, 4 } → { 1, 2, 3, 4 } with f (x) ≤ x; indeed,
Valid (f (1), f (2), f (3), f (4)) values
1,1,1,1 1,1,1,2 1,1,1,3 1,1,1,4
1,1,2,2 1,1,2,3 1,1,2,4 1,1,3,3
1,1,3,4 1,2,2,2 1,2,2,3 1,2,2,4
1,2,3,3 1,2,3,4

• The 45◦ line is (f (1), f (2), f (3), f (4)) = (1, 2, 3, 4).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 257
One-to-One (Injective) Functions
• A function f : A → B is called one-to-one or injective
if each element of B appears at most once as the image
of an element of A.
– f : R → R, where f (x) = x + 1.
• If | A | = m and | B | = n ≥ m, then there are

P (n, m) = n(n − 1) · · · (n − m + 1) (29)

one-to-one functions from A = { a1 , a2 , . . . , am } to B.a


– There are n choices for f (a1 ), n − 1 choices for f (a2 ),
etc.
a P (n, m) was defined in Eq. (1) on p. 13.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 258
The Birthday Problem
What is the probability of collision, C(N, q), when q balls
are thrown randomly into N ≥ q bins?
• There are N q ways of throwing the balls by Eq. (27) on
p. 242.
• By Eq. (29),

N (N − 1) · · · (N − q + 1)

of them have no collisions.


• The desired probability is hence
N (N − 1) · · · (N − q + 1)
C(N, q) = 1 − q
. (30)
N

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 259
The Proof (continued)
• We next simplify Eq. (30) with approximations:




1 2 q−1
C(N, q) = 1 − 1 − 1− ··· 1 −
N N N
 
1 + 2 + · · · + (q − 1)
≤ 1− 1−
N
q(q − 1)
= .
2N
• How about lower bounds?

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 260
The Proof (continued)
• From Eq. (30) on p. 259 again and inequality
1 − x ≤ e−x for 0 ≤ x ≤ 1,




1 2 q−1
C(N, q) = 1 − 1 − 1− ··· 1 −
N N N
1 2 q−1
≥ 1 − e− N − N −···− N

q(q−1)

= 1−e 2N .

• Assume 1 ≤ q ≤ 2N .
• Then exponent q(q − 1)/(2N ) ≤ 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 261
The Proof (continued)
• Recall inequality

(1 − e−1 ) x ≤ 1 − e−x

for 0 ≤ x ≤ 1.
• Hence
− q(q−1)
C(N, q) ≥ 1−e 2N


1 q(q − 1)
≥ 1−
e 2N
q(q − 1)
≥ 0.3 . (31)
N

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 262
The Proof (concluded)

• So, given 1 ≤ q ≤ 2N , we have
q(q − 1) q(q − 1)
0.3 ≤ C(N, q) ≤ 0.5 .
N N

• Pick q = Θ( N ) for a non-vanishing collision
probability.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 263
Numerical Examples
• The probability of (random) birthday collision out of q
people is C(365, q).

• Surprisingly, for q ≈ 365 = 19.1, the probability of
birthday collision is already high.
– C(365, 19) ≥ 0.281 by inequality (31).
– As C(365, 19) = 0.38, the lower bound is satisfactory.
• C(365, 23) = 0.51.
– With probability at least 50%, a group of 23 people
contains some people with the same birthday.
– But we failed to find a collision on October 11, 2004
with more than 23 people.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 264
Numerical Examples (continued)
• We failed to find a collision on March 22, 2012, with 20
people.
• We failed to find a collision on March 21, 2013, with 20
people.
• We failed to find a collision on April 10, 2014, with 13
people.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 265
Numerical Examples (concluded)
1

0.8
Probability

0.6

0.4

0.2

0
0 10 20 30 40 50 60 70
Number of persons

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 266

You might also like