properties of integers: mathematical inductionlyuu/dm/2012/20120315.pdf · properties of integers:...
Post on 28-Jun-2018
216 Views
Preview:
TRANSCRIPT
Properties of Integers: Mathematical
Induction
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 160
Mathematics is a deductive science.
— Bertrand Russell (1872–1970),
Introduction to Mathematical Philosophy (1919)
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 161
Common Setsa
N = {0, 1, . . .},
Z = {. . . ,−2,−1, 0, 1, 2, . . .},
Z+ = {1, 2, . . .},
R = set of real numbers,
Q = set of rational numbers.
a0 is a natural number!
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 162
The Well-Ordering Principlea
Theorem 36 (The well-ordering principle) Every
nonempty subset of Z+ contains a smallest element. (Z+ is
said to be well-ordered.)
• Real numbers are not well-ordered.
– {x ∈ R : x > 1} does not contain a smallest element.
• Rational numbers are not well-ordered.
– {x ∈ Q : x > 1} does not contain a smallest element.
aDefined by Cantor in 1883 and proved by Ernst Zermelo (1871–1953)
in 1904.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 163
Mathematical Inductiona
Theorem 37 Let S(n) denote an (open) mathematical
statement containing references to a positive integer n such
that
• S(1) is true and
• S(k + 1) is true whenever S(k) is true for arbitrarily
chosen k ∈ Z+.
Then S(n) is true for all n ∈ Z+.
aDedekind and Peano.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 164
The Proof
• Intuitively,
– If S(1) is true, then S(2) is true.
– But if S(2) is true, then S(3) is true.
– · · ·– So S(n) must be true for all n ∈ Z+?
• We need a proof based on more foundational principles.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 167
The Proof (continued)
• Let F = { t ∈ Z+ : S(t) is false }.
• Assume that F ̸= ∅.
• F has a least element ℓ by the well-ordering principle.
– So S(ℓ) is false.
• Clearly ℓ > 1 and, hence, ℓ− 1 ∈ Z+.
• Because ℓ− 1 ̸∈ F , S(ℓ− 1) is true.
• It follows that S(ℓ) is true, a contradiction.
• So F = ∅.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 168
Mathematical Induction and the Well-OrderingPrinciple
• The proof of induction says that the well-ordering
principle (p. 163) implies mathematical induction.
• Now we prove the converse.
• Let T ⊆ Z+ and T ̸= ∅.
• It suffices to show that T contains a smallest element.
• Let S(n) be the (open) statement:
“no element of T is smaller than n.”
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 169
The Proof (continued)
• S(1) is true as no positive integers are smaller than 1.
• Suppose S(k + 1) holds whenever S(k) does.
• By mathematical induction, S(n) is true for all n ∈ Z+.
• This means for any n ∈ Z+, no element of T is smaller
than n.
• But this is impossible as any integer in T must be
smaller than some integer.
• Hence there is a k ∈ Z+ such that S(k) is true but
S(k + 1) is not.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 170
The Proof (concluded)
• As S(k) holds, no element of T is smaller than k.
• As S(k + 1) does not hold, some elements of T are
smaller than k + 1.
• But as S(k) holds, these elements must equal k.
• Hence the smallest element of T exists and is k.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 171
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?
• Mathematical induction is merely a property of integers.
• It is deductive.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 172
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
(p. 82).
• 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.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 173
The Proof (continued)
• Suppose the last summand is n > 1.
– Replace the last summand by n− 1.
– The result is a composition of m.
– This correspondence is one-to-one (why?).
– So there are 2m−1 compositions in this case.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 174
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 21 (p. 83).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 175
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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 176
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. 163)!
• But that principle is equivalent to mathematical
induction (p. 169).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 177
Identities for Summations
Theorem 38 For n ∈ Z+,
n2(n+ 1)2
4=
n∑i=1
i3 =
(n∑
i=1
i
)2
.
• The identities are clearly true when n = 1.
• Assume the identities are true for n = k.
• By induction,
(k + 1)2(k + 2)2
4
=k2(k + 1)2
4+ (k + 1)3 =
k∑i=1
i3 + (k + 1)3 =k+1∑i=1
i3.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 178
The Proof (concluded)
• So the first identity holds.
• As for the second identity,(k+1∑i=1
i
)2
=
(k∑
i=1
i
)2
+ 2(k + 1)k∑
i=1
i+ (k + 1)2
=
(k∑
i=1
i
)2
+ 2(k + 1)k(k + 1)
2+ (k + 1)2
=
(k∑
i=1
i
)2
+ (k + 1)3
=k∑
i=1
i3 + (k + 1)3 =k+1∑i=1
i3.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 179
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.
aLeonardo Fibonacci (1175–1250).bThis is called a recursive definition; useful when it is simpler or when
an explicit formula is unavailable.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 180
An Identity for Fibonacci Numbers
Theorem 39∑n
i=0 F2i = FnFn+1 for n ∈ Z+.
• For n = 1, F 20 + F 2
1 = 1 = F1F2.
• Inductively,
k+1∑i=0
F 2i
=
(k∑
i=0
F 2i
)+ F 2
k+1 = FkFk+1 + F 2k+1
= Fk+1(Fk + Fk+1) = Fk+1Fk+2.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 181
Another Identity for Fibonacci Numbers
Theorem 40∑n
i=0 Fi = Fn+2 − 1 for n ∈ N.
• For n = 0, F0 = 0 = 1− 1 = F2 − 1.
• Inductively,
k+1∑i=0
Fi
=
(k∑
i=0
Fi
)+ Fk+1
= Fk+2 − 1 + Fk+1
= Fk+3 − 1.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 182
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 ∈ Zsuch that a = qb+ r, where 0 ≤ r < b.
• gcd(a, b) > 0 denotes the greatest common divisor of
a, b ∈ Z, where a ̸= 0 or b ̸= 0 (hence gcd(a, 0) = | a |).
• A prime is a positive integer larger than 1 whose only
divisors are itself and 1.
• There are infinitely many primes (p. 123).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 183
Application: d(n), Number of Positive Divisors
Theorem 41 Let n = pe11 pe22 · · · pett 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 · · · pstt ,
where 0 ≤ si ≤ ei.
• There are e1 + 1 choices for s1, e2 + 1 choices for s2, etc.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 184
Infinite Sets
• A set is countable if it is finite or if it can be put in
one-to-one correspondence with N (in which case it is
called countably infinite).
– Set of integers Z.∗ 0 ↔ 0, 1 ↔ 1, 2 ↔ 3, 3 ↔ 5, . . . ,−1 ↔ 2,−2 ↔
4,−3 ↔ 6, . . ..
– Set of positive integers Z+: i− 1 ↔ i.
– Set of positive odd integers: (i− 1)/2 ↔ i.
– Set of (positive) rational numbers: See next page.
– Set of squared integers: i ↔√i .a
aGalileo’s (1564–1642) paradox (1638).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 185
Rational Numbers Are Countable
5/2 5/1
1/5 1/2 1/1 1/3 1/4
2/1 2/2 2/3 2/4
3/1 3/2 3/3 3/4
4/1 4/2 4/3
1/6
2/5
6/1
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 186
Cardinality
• For any set A, define |A | as A’s cardinality (size).
• Two sets are said to have the same cardinality (written
as |A | = |B | or A ∼ B) if there exists a one-to-one
correspondence between their elements.
• 2A denotes set A’s power set, that is {B : B ⊆ A}.– If |A | = k, then | 2A | = 2k.
– So |A | < | 2A | when A is finite (see p. 189 for proof).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 187
Cardinality (concluded)
• |A | ≤ |B | if there is a one-to-one correspondence
between A and one of B’s subsets.
• |A | < |B | if |A | ≤ |B | but |A | ̸= |B |.
• If A ⊆ B, then |A | ≤ |B |.
• But if A ( B, then |A | < |B |?
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 188
A Combinatorial Proof for k < 2k
• Let
A = {1, 2, . . . , k}
be a set with k elements.
• |2A| = 2k.
• But
2A = {{1}, {2}, . . . , {k}, {1, 2}, . . . , {1, 2, . . . , k}}.
• Hence k < |2A| = 2k.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 189
Cardinality and Infinite Setsa
• Suppose A and B are infinite sets.
• Then it is possible that A ( B and yet |A | = |B |.– The set of integers properly contains the set of odd
integers.
– But the set of integers has the same cardinality as
the set of odd integers.b
• This is contrary to the axiom of Euclid that the whole is
greater than any of its proper parts.
• A lot of “paradoxes.”aRussell (1914), “it has taken two thousand years to answer.”bLeibniz uses it to “prove” that there are no infinite numbers (Russell,
1914).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 190
The point of philosophy is
to start with something so simple
as not to seem worth stating,
and to end with something
so paradoxical that no one will believe it.
— Bertrand Russell (1872–1970)
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 191
Cantor’s Theorem
Theorem 42 The set of all subsets of N (2N) is infinite and
not countable.
• Suppose (2N) is countable with f : N → 2N being a
one-to-one correspondence.a
• Consider the set B = {k ∈ N : k ̸∈ f(k)} ⊆ N.
• Suppose B = f(n) for some n ∈ N.aNote that f(k) is a subset of N.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 192
The Proof (concluded)
• If n ∈ f(n) = B, then n ∈ B, but then n ̸∈ B by B’s
definition.
• If n ̸∈ f(n) = B, then n ̸∈ B, but then n ∈ B by B’s
definition.
• Hence B ̸= f(n) for any n.
• f is not a one-to-one correspondence, a contradiction.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 193
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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 194
Cantor’s Diagonalization Argument Illustrated
f(1)
f(2)
f(3)
f(4)
f(5)
f(6)
B
1 2 3 4 5 6
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 195
Other Uncountable Setsa
• Real numbers are not countable.
– So there are real numbers that cannot be defined in a
finite number of words.
• Transcendental numbers are not countable.b
• So in a sense, most real numbers are transcendental.
aCantor.bA number is algebraic if it is a root of a polynomial equation with
integer coefficients. A real number that is not algebraic is transcen-
dental (Euler).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 196
Application: Existence of Uncomputable Problems
• Every program is a finite sequence of 0s and 1s, thus a
nonnegative integer.
• Hence every program corresponds to some integer.
• It follows that the set of programs is as large as N.
• Now consider functions from N to {0, 1}.
• As each function uniquely defines a subset of N, theircardinality is |2N|.– {i : f(i) = 1} ⊆ N.
• As |N| < |2N| (p. 192), there are functions for which no
programs exist.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 197
It is unworthy of excellent men
to lose hours like slaves in the labor of
computation.
— Gottfried Wilhelm von Leibniz (1646–1716)
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 199
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, . . .}.
• Ak =
k︷ ︸︸ ︷A×A× · · · ×A.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 200
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.aPeirce (1870).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 201
Relations (concluded)
• If |A | = m and |B | = n, then there are
2mn
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.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 202
Functionsa
• Let A,B be nonempty sets.
• A function (mapping) f from A to B is denoted by
f : A → B.
– A is called the domain and B is called the
codomain of f .
• 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 called the image of a under f , whereas 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 .
aLeibniz (1692).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 204
Number of Functions
If |A | = m and |B | = n, then there are
|B ||A | = nm (18)
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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 205
Number of Booleana Functions
• A function from {0, 1}m to {0, 1} is called a boolean
function.
– For example, f(x1, x2) = x1 ∧ x2 is a boolean
function from {0, 1}2 to {0, 1}.
• There are
2(2m) (19)
boolean functions.
– Eq. (18) on p. 205 with |A | = 2m and |B | = 2.
– Alternative proof: The truth table has 2m rows, and
each row can give you 0 or 1.
aGeorge Boole (1815–1864).
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 207
Number of Boolean Functions (concluded)
• In general, a boolean function maps {0, 1}m to {0, 1}n.
• There are
2(n2m)
such boolean functions.
– Eq. (18) on p. 205 with |A | = 2m and |B | = 2n.
– Alternative proof: The truth table has 2m rows, and
each row has n bits of output, for a total of n2m bits
to set.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 208
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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 209
Number of Partial Functions
If |A | = m and |B | = n, then there are
m−1∑i=1
(m
i
)ni
partial functions from A to B.
• There are(mi
)ways to choose an A′ ( A of size i ≥ 1.
• For each such A′, there are ni functions from A′ to B by
Eq. (18) on p. 205.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 210
Monotone Increasing Functions
A function f : {1, 2, . . . ,m} → {1, 2, . . . , n} is monotone
increasing if f(i) ≤ f(j) whenever i < j.
Theorem 43 There are(m+n−1
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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 211
The Proof (continued)
• There are m+ 1 increments:
f(i+ 1)− f(i), 0 ≤ i ≤ m.
• They must all be nonnegative.
• We also know the total increment is fixed, at
f(m+ 1)− f(0) = n− 1.
• So the goal is the number of nonnegative integer
solutions of x1 + x2 + · · ·+ xm+1 = n− 1.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 212
The Proof (continued)
0 0 2
1
m 0
f ( i ) n
f ( m ) - f ( m - 1)
n - f ( m )
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 213
The Proof (continued)
• Each such function corresponds to a solution of
xi = f(i)− f(i− 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⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 214
The Proof (concluded)
• By the equivalency result on p. 72, the desired count is((m+ 1) + (n− 1)− 1
n− 1
)=
(m+ n− 1
n− 1
)=
(m+ n− 1
m
).
• The number is(2n−1
n
)when m = n.
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 215
An Example: Monotone Increasing Functions
• Take m = 4 and n = 3.
• The formula says there are(4+3−1
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
c⃝2012 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 216
top related