Вы находитесь на странице: 1из 75

Onto (Surjective) Functions

• A function f : A → B is called onto or surjective if


f (A) = B.
– Necessarily, | A | ≥ | B |.
– f : R → R, where f (x) = x3 , is onto.
• If | A | = m and | B | = n, then there are
n  
n
(−1)k (n − k)m (32)
n−k
k=0

onto functions from A to B.a


• Incidentally Eq. (32) equals 0 for m < n, as desired.
a Proofs appear on p. 292 and p. 418.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 267
Distinct Objects into Distinct Containers with None
Empty
• Distribute m distinct objects into n ≤ m distinct
containers with no container left empty.
• There are  
n
 n
(−1)k (n − k)m (33)
n−k
k=0
ways.
– Identify a distribution with an onto function.
– Think of the objects a1 , a2 , . . . in the container
labeled b as signifying

f (a1 ) = f (a2 ) = · · · = b.

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

b B

c C

d D

e E

f F

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 269
Application: A Combinatorial Identity
n
  
k n
(−1) (n − k)n = n!. (34)
n−k
k=0

• By Eq. (32) on p. 267, there are


n  
n
(−1)k (n − k)n
n−k
k=0

onto functions from X to X, where | X | = n.


• But the number of such onto functions is also n!.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 270
An Example
• Suppose there are m = 6 distinct objects and n = 3
distinct containers.
• There are 540 ways to distribute these objects into the
containers with none empty by Eq. (33) on p. 268.
• Let us verify this number with the alternative method
from p. 78.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 271
An Example (continued)
• Calculate
(x1 + x2 + x3 )6 = (x61 + · · · + x63 )
 5 5
+6 x1 x2 + · · · + x2 x3
 
+15 x41 x22 + · · · + x22 x43
 3 3 3 3
+20 x1 x2 + · · · + x2 x3
3
  

+30 x41 x2 x3 + · · · + x1 x2 x43
6
  

+60 x31 x22 x3 + · · · + x1 x22 x33
+90x21 x22 x23 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 272
An Example (concluded)
• Only the last three terms are relevant:
3
 4  

30 x1 x2 x3 + · · · + x1 x2 x43
6
 3 2  

+60 x1 x2 x3 + · · · + x1 x22 x33


+90x21 x22 x23 .

• The desired count is thus

30 × 3 + 60 × 6 + 90 = 540,

a match.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 273
Distinct Objects into Identical Containers with None
Empty
• Distribute m distinct objects into n ≤ m identical
containers with no container left empty.
• Alternatively, partition m objects into n sets or groups.
• The number of ways is denoted by S(m, n), the Stirling
number of the second kind.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 274
A Formula for the Stirling Number
• The formula is
n  
1 n
S(m, n) = (−1)k (n − k)m (35)
n! n−k
k=0
n  
1 n m
= (−1)n−k k . (36)
n! k
k=0

– Use formula (33) on p. 268.


– Then remove the container labels by dividing it by n!
(why?).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 275
Some Boundary Conditions
• Note that

S(m, 0) = 0, if m > 0, (37)


S(0, 0) = 1, if we assume 00 = 1,
S(m, n) = 0, if m < n,

as they should be.


• As the left-hand side of (34) on p. 270 equals n! S(n, n),

S(n, n) = 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 276
Stirling Numbers of the Second Kind S(20, n)
Stiring number of the 2nd kind
13
1.4·10
13
1.2·10
13
1·10
12
8·10
12
6·10
12
4·10
12
2·10
5 10 15 20

It is unimodal in general.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 277
A Special Case: S(m, 2) = 2m−1 − 1 for m > 0
• First proof: From Eq. (35) on p. 275,
     
1 2 m 2 m 2 m
S(m, 2) = 2 − 1 + 0 = 2m−1 − 1.
2 2 1 0

• Second proof:
– Divide m objects into 2 nonempty parts.
– One of the parts contains the last object and some
subset of the first m − 1 objects.
– There are 2m−1 ways to choose the subset.
– Subtract 1 from 2m−1 to rule out selecting all the
m − 1 objects.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 278
An Example
• Suppose there are m = 6 distinct objects and n = 3
identical containers.
• There are S(6, 3) = 90 ways to distribute these objects
into the containers with none empty.
• Let us verify this number with the alternative method
from p. 271.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 279
An Example (continued)
• Again, calculate
(x1 + x2 + x3 )6 = (x61 + · · · + x63 )
 5 5
+6 x1 x2 + · · · + x2 x3
 
+15 x41 x22 + · · · + x22 x43
 3 3 3 3
+20 x1 x2 + · · · + x2 x3
3
  

+30 x41 x2 x3 + · · · + x1 x2 x43
6
  

+60 x31 x22 x3 + · · · + x1 x22 x33
+90x21 x22 x23 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 280
An Example (continued)
• Only the last three terms are relevant:
3
 4  

30 x1 x2 x3 + · · · + x1 x2 x43
6
 3 2  

+60 x1 x2 x3 + · · · + x1 x22 x33


+90x21 x22 x23 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 281
An Example (continued)
• Consider the case where the containers contain 4
objects, 1 object, and 1 object.
• We look at the coefficient of

x41 x2 x3 + · · · + x1 x2 x43 .

• It is 30.
• So there are 30 distributions if, say, container x1 holds 4
objects, container x2 1 object, and container x3 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 282
An Example (continued)
• Containers x2 and x3 can have their objects swapped to
yield a new distribution.
• But this pair of distributions become identical after the
labels are removed.
• So the desired count is 30/2 = 15.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 283
An Example (continued)
• Consider the case where the containers contain 3
objects, 2 objects, and 1 object.
• We look at the coefficient of

x31 x22 x3 + · · · + x1 x22 x33 .

• It is 60.
• So there are 60 distributions if, say, container x1 holds 3
objects, container x2 2 objects, and container x3 1.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 284
An Example (continued)
• Because 3, 2, and 1 are distinct, label removal will not
change the count.
• So the desired count is 60.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 285
An Example (continued)
• Consider the case where the containers contain 2
objects, 2 objects, and 2 objects.
• We look at the coefficient of

x21 x22 x23 .

• It is 90.
• So there are 90 distributions if, say, container x1 holds 2
objects, container x2 2 objects, and container x3 2.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 286
An Example (concluded)
• Because 2, 2, and 2 are identical, label removal will
reduce the count by a factor of 3!.
• So the desired count is 90/3! = 15.
• In conclusion, the total count is

15 + 60 + 15 = 90,

a match with S(6, 3).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 287
Functions with a Given Range Size
• There are n!S(m, n) onto functions from a domain of
size m to a codomain of size n.
• In general, there are P (n, r) S(m, r) functions from a
domain of size m to a codomain of size n with a range of
size r.a
n

– There are r to choose the range.


– Given a range as the codomain, there are r!S(m, r)
onto functions.
– Hence the desired count is
 
n
r!S(m, r) = P (n, r) S(m, r). (38)
r
a Recall from Eq. (1) on p. 13 that P (n, r) = n(n − 1) · · · (n − r + 1).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 288
Functions with a Given Range Size (concluded)
• In the special case of r = n, Eq. (38) reduces to

P (n, n) S(m, n) = n!S(m, n),

as it should be

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 289
An Identity for Stirling Numbers
m

S(m, k) x(x − 1) · · · (x − k + 1) = xm . (39)
k=1

• The number of functions from A to B is xm , where


| A | = m and | B | = x (p. 242).
• By Eq. (38) on p. 288,

S(m, k) x(x − 1) · · · (x − k + 1)

is the number of functions whose range has cardinality k.


• This proves the identity for x ∈ Z+ .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 290
An Identity for Stirling Numbers (concluded)
• Hence the polynomial
m

S(m, k) x(x − 1) · · · (x − k + 1) − xm
k=1

has more than m roots, its degree.


• Therefore, it must be identically zero.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 291
Finally, Proof of Eq. (32) on P. 267
It suffices to prove Eq. (36) on p. 275:
1 
n  
n−j n m
(−1) j
n! j=0 j

n j
(−1)n−j 
= S(m, r)j(j − 1) · · · (j − r + 1) by Eq. (39)
j=0
(n − j)!j! r=0
j
n 
 1
= (−1)n−j S(m, r)
j=0 r=0
(n − j)!(j − r)!

n n
S(m, r)  (n − r)!
= (−1)n−j
r=0
(n − r)! j=r (n − j)!(j − r)!
n−1
 S(m, r)
= S(m, n) + (1 − 1)n−r = S(m, n) by Eq. (10) on p. 59.
r=0
(n − r)!

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 292
A Recurrence Relation for Stirling Numbers


⎪ if m + 1 = n,
⎨ 1,
S(m + 1, n) = 1, if n = 1, (40)



S(m, n − 1) + nS(m, n), if 2 ≤ n ≤ m.

• Recall that S(m + 1, n) counts the number of ways

a1 , a2 , . . . , am+1

is distributed among n identical containers, with no


container left empty.
• Object am+1 can be in a container all by itself or with
other objects.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 293
The Proof (concluded)
• S(m, n − 1) is the number of ways a1 , a2 , . . . , am are
distributed among n − 1 identical containers, with no
containers left empty and with am+1 alone in the
remaining container.
• nS(m, n) is the number of ways a1 , a2 , . . . , am are
distributed among n identical containers, with no
container left empty and with am+1 put in any of the n
containers.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 294
Another Recurrence Relation for Stirling Numbers
m−1
  
m−1
S(m, n) = S(k, n − 1), n ≤ m. (41)
k
k=n−1

• The left-hand side denotes the number of distributions


of m distinct objects into n identical containers with
none left empty.
• Fix an object O.
• Call a container that has O the O-container.
• The O-container must contain r other objects, where
0 ≤ r ≤ m − n.a
a So the O-container contains r + 1 objects.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 295
The Proof (concluded)
m−1

• These r objects can be chosen in r ways.


• For each choice, the other n − 1 containers may be filled
in S(m − r − 1, n − 1) ways.
• Hence


m−n
m−1
S(m, n) = S(m − 1 − r, n − 1)
r=0
r


m−n
m−1
= S(m − 1 − r, n − 1)
r=0
m − 1 − r


m−1
m−1
= S(k, n − 1).
k=n−1
k

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

A Special Case: S(m, m − 1) = 2


for m > 0a
From Eq. (41) on p. 295,
S(m, m − 1)
 m − 1
m−1
= S(k, m − 2)
k
k=m−2
   
m−1 m−1
= S(m − 2, m − 2) + S(m − 1, m − 2)
m−2 m−1
= (m − 1) + S(m − 1, m − 2)
= (m − 1) + (m − 2) + S(m − 2, m − 3)
 
m
= (m − 1) + (m − 2) + · · · + 1 = .
2
a Checkthat the proof works even when m = 1. Thanks to a lively
discussion on March 29, 2018.

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

S(m, m − 1) = 2
the Easier Way
• Consider any distribution of m distinct objects into
m − 1 identical containers with no container left empty.
• There must be one container with 2 objects and m − 2
containers with 1 object (why?).
m

• The 2-object container can be composed in 2 ways.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 298
Bella Numbers
• The mth Bell number Pm is the number of partitions of
m distinct objects.b
• Alternatively, there are Pm ways for m distinct objects
to form groups.
– There are 5 ways to partition 3 distinct objects:

{{ 1, 2, 3 }}, {{ 1 }, { 2 }, { 3 }},
{{ 1, 2 }, { 3 }}, {{ 1, 3 }, { 2 }}, {{ 1 }, { 2, 3 }}.

a Eric
Temple Bell (1883–1960).
b It differs from the Stirling number of the second kind in that the

number of partitions is not specified.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 299
A Formula for Bell Numbers
• By convention P0 = 1.
• For m > 0,a
m
 ∞

Pm = S(m, k) = S(m, k).
k=0 k=0

– The above formula also works for P0 .b


• Indeed, P3 = 5.
a Recall that S(m, 0) = 0 for m > 0 by Eq. (37) on p. 276.
b Recall that S(0, 0) = 1 on p. 276.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 300
Dobinski’s Equality
• Now,

 k  
1 k−j k
Pm = (−1) jm
k! j=0 j
k=0
∞ ∞
j m  (−1)k−j
=
j=0
j! (k − j)!
k=j

1  jm
= .
e j=0 j!

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 301
A Recurrence Relation for Bell Numbers

⎨ 1, if n = 0,
Pn =

⎩ n−1 n−1 Pk ,
(42)
k=0 k if n ≥ 1.

• Let | S | = n and fix an x ∈ S.
• A group with k elements that contains x can be chosen
n−1

in k−1 ways.
• The remaining n − k elements can be partitioned in
Pn−k ways.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 302
The Proof (concluded)
• So the number of partitions in which the group
n−1

containing x has k elements is k−1 Pn−k .


• Finally,
n 
 
n−1
Pn = Pn−k
k−1
k=1
n  
n−1
= Pn−k
n−k
k=1

 n − 1
n−1
= Pk .
k
k=0

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 303
Bijective Functions
• A function f : A → B is bijective or a one-to-one
correspondencea if it is one-to-one and onto.
– Necessarily, | A | = | B |.
• For example, f : Z → Z is bijective for f (x) = x.
• But f (x) = x is not bijective if f : Z → Q (it is not
onto).
• If | A | = | B | = m, then there are m! bijective functions
from A to B.
a Notethe definitional difference between a one-to-one (injective) func-
tion (p. 258) and a one-to-one correspondence.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 304
Function Composition
• Suppose f : A → B and g : B → C.
• The composite function g ◦ f : A → C is defined as

(g ◦ f )(a) = g(f (a))

for each a ∈ A.a


• Note that f is applied first.
• Also, f ’s range must be a subset of g’s domain for g ◦ f
to work.
a Read as “g circle f ,” “g composed with f ,” “g after f ,” “g following
f ,” or “g of f .”

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 305
A B C
a c
f g

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 306
Properties of Composite Functions
Theorem 43 Let f : A → B and g : B → C. If f and g are
one-to-one, then g ◦ f is also one-to-one.
• Let a1 , a2 ∈ A with

(g ◦ f )(a1 ) = (g ◦ f )(a2 ).

• Then
g(f (a1 )) = g(f (a2 )).

• As g is one-to-one, this implies

f (a1 ) = f (a2 ).

• As f is one-to-one, this implies a1 = a2 , as desired.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 307
Function Composition Is Associative
Theorem 44 Let f : A → B, g : B → C, and h : C → D
Then (h ◦ g) ◦ f = h ◦ (g ◦ f ).
For every a ∈ A,

((h ◦ g) ◦ f )(a)
= (h ◦ g)(f (a))
= h(g(f (a)))
= h((g ◦ f )(a))
= (h ◦ (g ◦ f ))(a).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 308
Powers of Functions
• As function composition is associative (p. 308), we
simply write
h◦g◦f
in place of (h ◦ g) ◦ f or h ◦ (g ◦ f ).
• Let f : A → A.
• Define f 1 = f .
• In general,
n
  
n+1 n
f = f ◦ (f ) = · · · = f (f (f (· · · f )))

for n ∈ Z+ .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 309
The Identity Function
• Function 1A : A → A is defined by

1A (a) = a

for all a ∈ A.
• This function is called the identity function for A.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 310
Invertibility of Functions
• Suppose f : A → B.
• f is said to be invertible if there is a function
g : B → A such that

g ◦ f = 1A and f ◦ g = 1B .

• So
– g(f (a)) = a for all a ∈ A.
– f (g(b)) = b for all b ∈ B.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 311
Uniqueness of the Inverse Function
Theorem 45 Suppose f : A → B is invertible. Then a
function g : B → A such that

g◦f = 1A ,
f ◦g = 1B ,

must be unique.
• Suppose there is a function h : B → A with

h◦f = 1A ,
f ◦h = 1B .

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

h = h ◦ 1B
= h ◦ (f ◦ g)
= (h ◦ f ) ◦ g
= 1A ◦ g
= g.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 313
The Inverse Function
• By Theorem 45 (p. 312), we call the function g there the
inverse of f , written as

f −1 .

• Again by Theorem 45 (p. 312), if f is invertible, so is


f −1 , whose inverse is (f −1 )−1 by definition.
• In fact, if f is invertible, then

(f −1 )−1 = f.

– Note that (f −1 )−1 = f −2 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 314
Conditions for Invertibility
Theorem 46 f is invertible if and only if it is bijective.
• Assume that f : A → B is invertible first.
• Then by Theorem 45 (p. 312) there is a unique function
g : B → A such that g ◦ f = 1A and f ◦ g = 1B .
• Suppose a1 , a2 ∈ A such that f (a1 ) = f (a2 ).
• Then g(f (a1 )) = g(f (a2 )); i.e.,

(g ◦ f )(a1 ) = (g ◦ f )(a2 ).

• Finally, (1A )(a1 ) = (1A )(a2 ); i.e., a1 = a2 .


• Hence f is one-to-one.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 315
The Proof (continued)
• Let b ∈ B.
• Then
b = (1B )(b) = (f ◦ g)(b) = f (g(b)).

• So f is onto.
• Conversely, suppose f is bijective.
• Define function g : B → A by

g(b) = a

whenever f (a) = b.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 316
The Proof (concluded)
• As f is onto, for each b ∈ B there is an a ∈ A such that
f (a) = b.
• This a is also unique.
– If f (a1 ) = f (a2 ) = b, then a1 = a2 because f is
one-to-one.
• Hence g is a well-defined function.
• By g’s definition, g ◦ f = 1A and f ◦ g = 1B .
• Hence g = f −1 by Theorem 45 (p. 312).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 317
Inverse of the Composite Function
Theorem 47 If f : A → B and g : B → C are invertible,
then g ◦ f is also invertible and

(g ◦ f )−1 = f −1 ◦ g −1 .

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 318
Relations: The Second Time Around

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 319
Whatsoever we imagine is finite.
Therefore there is no idea, or conception
of any thing we call infinite.
— Thomas Hobbes (1588–1679),
Leviathan (1651)

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 320
Reflexive Relations
• R ⊆ A × A is a relation on A.
• R is reflexive if (x, x) ∈ R (or xRx) for all x ∈ A.
– “≤” is reflexive because x ≤ x.
– “=” is reflexive because x = x.
• If | A | = m, then there are
2
2m −m

reflexive relations on A.
– Except the m required (x, x) ∈ R, membership in R
for the other m2 − m pairs of A × A is arbitrary.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 321
a b c d e f

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 322
Irreflexive Relations
• Relation R on A is irreflexive if (x, x) ∈ R for all
x ∈ A.
– “<” is irreflexive because x < x.
• For | A | = m, there are
m2 −m
2

irreflexive relations on A (see next page).


• “Being irreflexive” is not the same thing as “not being
reflexive.”a
a Which means there is an x such that (x, x) ∈ R. By Eq. (26) on p.
2 2
238, there are 2m − 2m −m relations that are not reflexive.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 323
a b c d e f

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 324
Symmetric Relations
• R is symmetric if (x, y) ∈ R ⇒ (y, x) ∈ R for all
x, y ∈ A.
• For example, “=” and “=” are symmetric.
– If x = y, then y = x.
– If x = y, then y = x.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 325
Number of Symmetric Relations
Lemma 48 If | A | = m, then there are
2
2(m +m)/2

symmetric relations on A.
m

• There are m (x, x)s and 2 = (m2 − m)/2 { x, y }s with


x = y.a
• Number of decisions to make for membership in R:

m + (m2 − m)/2 = (m2 + m)/2.


a Or focus on the upper triangular elements on the next page.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 326
a b c d e f

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 327
Number of Reflexive Symmetric Relationsa
Lemma 49 If | A | = m, then there are
(m2 −m)/2
2

reflexive symmetric relations on A.


m

• There are 2 = (m2 − m)/2 { x, y }s with x = y.


• Number of decisions to make for membership in R:
m2 − m
.
2
a The number of irreflexive symmetric relations is the same.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 328
a b c d e f

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 329
Transitive Relations
• R is transitive if (x, y) ∈ R ∧ (y, z) ∈ R ⇒ (x, z) ∈ R
for all x, y, z ∈ A.
– “≤” is transitive.
– “<” is transitive.
– “⊆” is transitive.
• The number of transitive relations on a finite set seems
hard to derive.a
a It will make a nice research project.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 330
Where five economists are gathered together
there will be six conflicting opinions,
and two of them will be held by Keynes.
— Thomas Jones (1954)

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 331
The Pigeonhole Principlea
• If m pigeons occupy n pigeonholes and m > n, at least
one pigeonhole has two or more pigeons roosting in it.
• With m pigeons and n single-occupancy pigeonholes
with m > n, at least one pigeon is “homeless.”
a Dirichlet (1834).

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 332
The Pigeonhole Principle (continued)
• If m pigeons occupy n pigeonholes and m > n, at least
one pigeonhole has ≥ (m − 1)/n + 1 pigeons.a
– Otherwise, every pigeonhole has ≤ (m − 1)/n
pigeons.
– So the number of pigeons is at most
n (m − 1)/n ≤ m − 1 < m, a contradiction.
• If nk + 1 pigeons occupy n pigeonholes and k ∈ Z+ , at
least one pigeonhole has ≥ k + 1 pigeons.
– Otherwise, the number of pigeons is at most nk.
a It
may also be called the averaging principle. It is similar to the
mean-value theorem in calculus.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 333
The Pigeonhole Principle (concluded)
Theorem 50 If there are ≥ p1 + p2 + · · · + pn − n + 1
pigeons occupying pigeonholes 1, 2, . . . , n, then for some j,
pigeonhole j contains ≥ pj pigeons.
• Assume otherwise: Every pigeonhole j has at most
pj − 1 pigeons.
• The total number of pigeons is at most

(p1 − 1) + (p2 − 1) + · · · + (pn − 1)


= p1 + p2 + · · · + pn − n,

a contradiction.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 334
Johann Peter Gustav Lejeune Dirichlet (1805– 1859)

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 335
Application: Friendship
• Assumption 1: If A is a friend of B’s, then B is also a
friend of A’s.
• Assumption 2: One is not a friend of oneself.
Theorem 51 In any group of people, there exist 2 people
who have the same number of friends in the group.
• Let xi denote the number of friends of person i, where
0 ≤ i ≤ n − 1.
• Note that 0 ≤ xi ≤ n − 1.
• Suppose xi are distinct.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 336
The Proof (concluded)
• Relabel them so that x0 < x1 < · · · < xn−1 .
• Then xi = i for all i.
• Remove the friendless person 0 from the group.
• The remaining xi ’s will not be changed for the smaller
group of n − 1 people.
• Hence person n − 1 is a friend of n − 1 other people.
• This is impossible because there are only n − 1 people.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 337
Application: Dividends
Theorem 52 Let n ∈ Z+ be odd. Then there exists a
positive integer m ≤ n such that n | (2m − 1).
• Consider n + 1 integers: 21 − 1, 22 − 1, . . . , 2n+1 − 1.
• There exist s < t such that 2s − 1 ≡ 2t − 1 mod n.
– Only n remainders are possible.
• So n | (2t − 2s ), or n | (2t−s − 1) 2s .
• Because n is odd, n | (2t−s − 1) .
• Pick m = t − s to finish the proof.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 338
Application: Coding Theory
Theorem 53 Let n ∈ Z+ and q ∈ Z+ such that
gcd(n, q) = 1. Then n | (q m − 1) for some 1 ≤ m ≤ n.
• Use the division algorithm to yield the following set of
n + 1 equations:

q = Q1 n + r1 ,
q2 = Q2 n + r2 ,
..
.
q n+1 = Qn+1 n + rn+1 .

• Above, 0 ≤ ri ≤ n − 1 for all i.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 339
The Proof (concluded)
• Because there are n + 1 equations with n possible
remainders, two remainders must be identical, say

ri = rj , i < j.

• Hence
q j − q i = Qj n + rj − Qi n − ri .

• This implies that

q i (q j−i − 1) = (Qj − Qi ) n.

• Because gcd(n, q) = 1, n must divide q j−i − 1.


• Finally, set m = j − i to finish the proof.

c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 340
Application: Mutual Divisibility
Theorem 54 (Putnam, 1958) Any subset of n + 1
numbers from { 1, 2, . . . , 2n } must contain x, y such that x
divides y or y divides x.
• Express every positive integer as 2k m, where m is odd.
• There are at most n possibilities for m:

1, 3, 5, . . . , 2n − 1.

• Hence any set of n + 1 integers must contain two x, y


with the same m: x = 2k1 m and y = 2k2 m.
• Now, x | y if k1 < k2 and y | x otherwise.

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

Вам также может понравиться