combinatorics - njutcs.nju.edu.cn/slides/comb2011/comb1.pdfenumerative combinatorics, volume 1 alon...

41
Combinatorics 南京大学 尹一通

Upload: others

Post on 27-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Combinatorics南京大学尹一通

Page 2: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Combinatorics

• Enumeration (counting):

• Existence:

• Extremal:

• Ramsey:

• Optimization:

• Construction (design):

How many configurations having this structure?

Do configurations with this structure exist?

When a system is sufficiently large, some structure must emerges.

How large/small does a system have to be to have this structure?

Find the optimal (according to some criterion) configuration satisfying certain structural constraints.

Construct a configuration with this structure.

Page 3: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Tools (and prerequisites)

• Combinatorial(elementary) techniques;

• Algebra (linear & abstract);

• Probability theory;

• Analysis (calculus).

Page 4: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Course Info

• Instructor: 尹⼀一通

[email protected], [email protected]

• Office hour: Wednesday, 2pm-5pm, 804

• course homepage:

Page 5: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Textbook

van Lint and Wilson, A course in Combinatorics, 2nd Edition.

Page 6: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Reference Books

Cameron, Combinatorics: Topics, Techniques, Algorithms

Graham, Knuth, and Patashnik, Concrete Mathematics: A Foundation for Computer Science

Aigner and Ziegler. Proofs from THE BOOK.

Page 7: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Stanley, Enumerative Combinatorics, Volume 1

Alon and Spencer, The Probabilistic Method

Jukna, Extremal Combinatorics: With Applications in Computer Science.

Reference Books

Cook, Cunningham, Pulleyblank, and Schrijver. Combinatorial Optimization.

Page 8: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Basic Enumeration

Page 9: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Enumeration(counting)

• How many character strings of length ?

• How many trees of vertices?

• How many ways of returning homeworks to students so that no one receives his/her own homework.

• How many ways to change yuan?

Sample questions:n

n

n

nn

n

n

n

|Sn|f(n) =

Page 10: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Tuples

mn|[m]n| =

Product rule:

|S ⇥ T | = |S| · |T |finite sets S and T

[m]⇥ · · ·⇥ [m]⇤ ⇥� ⌅n

[m]n =

[m] = {0, 1, . . . , m� 1}{1, 2, . . . ,m}

Page 11: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Functions

[n] [m]

f : [n]� [m]

count the # of functions

� [m]n

one-one correspondence

[n]� [m]⇥ [m]n

(f(1), f(2), . . . , f(n))

Page 12: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Functions

[n] [m]

f : [n]� [m]

count the # of functions

one-one correspondence

[n]� [m]⇥ [m]n

Bijection rule:

finite sets S and T

⇤� : S1�1����⇥

on�toT =� |S| = |T |

Page 13: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Functions

[n] [m]

f : [n]� [m]

count the # of functions

one-one correspondence

[n]� [m]⇥ [m]n

|[n]� [m]| = |[m]n| = mn

“Combinatorial proof.”

Page 14: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Injections

[n] [m]

count the # of 1-1 functions

one-one correspondence

� � [m]n of distinct elements

� = (f(1), f(2), . . . , f(n))

n-permutation:

=m!

(m � n)!m(m � 1) · · · (m � n + 1)(m)n =

“m lower factorial n”

f : [n]1-1�� [m]

Page 15: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

SubsetsS = { 1, 2, 3 }

subsets of S: ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}

S = {x1, x2, . . . , xn}

Power set:��2S

�� =

2S = {T | T � S}

Page 16: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

SubsetsS = {x1, x2, . . . , xn}

Power set:��2S

�� =

Combinatorial proof:

A subset T � S corresponds to a string of n bit,where bit i indicates whether xi ⇥ T .

2S = {T | T � S}

Page 17: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

SubsetsS = {x1, x2, . . . , xn}

Power set:��2S

�� =

Combinatorial proof:

� : 2S � {0, 1}n �(T )i =

�1 xi � T

0 xi ⇥� T

� is 1-1 correspondence

|{0, 1}n| = 2n

2S = {T | T � S}

Page 18: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

SubsetsS = {x1, x2, . . . , xn}

Power set:��2S

�� =

A not-so-combinatorial proof:

Sn = {x1, x2, . . . , xn} f(n) =��2Sn

��Let and

f(n) = 2f(n� 1)

2S = {T | T � S}

Page 19: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Sn = {x1, x2, . . . , xn} f(n) =��2Sn

��Let and

f(n) = 2f(n� 1)

2Sn = {subsets of Sn that does not contain xn}{subsets of Sn that contains xn}

Sum rule:finite disjoint sets S and T

|S � T | = |S| + |T |

��2Sn�� =

��2Sn�1�� +

��2Sn�1�� = 2f(n� 1)

Page 20: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

SubsetsS = {x1, x2, . . . , xn}

2S = {T | T � S}Power set:��2S

�� =

Sn = {x1, x2, . . . , xn} f(n) =��2Sn

��Let and

f(n) = 2f(n� 1)

f(0) = |2�| = 1

2n

Page 21: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Three rules

Product rule:

|S ⇥ T | = |S| · |T |finite sets S and T

Sum rule:finite disjoint sets S and T

|S � T | = |S| + |T |

Bijection rule:

finite sets S and T

⇤� : S1�1����⇥

on�toT =� |S| = |T |

Page 22: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Subsets of fixed sizeS = { 1, 2, 3 }

2-subsets of S: {1, 2}, {1, 3}, {2, 3}

S = {x1, x2, . . . , xn}�

S

k

⇥= {T � S | |T | = k}k-uniform

⇥n

k

⇤=

����

⇥S

k

⇤����

“n choose k”

Page 23: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Subsets of fixed size

�n

k

⇥=

n(n� 1) · · · (n� k + 1)k(k � 1) · · · 1 =

n!k!(n� k)!

# of ordered k-subsets: n(n� 1) · · · (n� k + 1)

# of permutations of a k-set: k(k � 1) · · · 1

Page 24: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Subsets of fixed size

�n

k

⇥=

n(n� 1) · · · (n� k + 1)k(k � 1) · · · 1 =

n!k!(n� k)!

n! “n factorial”

(n)k = n(n� 1) · · · (n� k + 1)

“n lower factorial k”

=

�n

k

�k!

Page 25: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Binomial coefficients

Binomial coefficient:

�n

k

�n

k

⇥=

n!k!(n� k)!

1.

�n

k

⇥=

�n

n� k

2.n⇤

k=0

�n

k

⇥= 2n

choose a k-subset ⇔choose its compliment

0-subsets + 1-subsets + ... + n-subsets = all subsets

Page 26: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Binomial theorem

Binomial Theorem

(1 + x)n =n⇤

k=0

�n

k

⇥xk

(1 + x)n = (1 + x)(1 + x) · · · (1 + x)⇤ ⇥� ⌅n

# of xk: choose k terms out of n

Proof:

Page 27: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Let x = 1.

S = {x1, x2, . . . , xn}

Binomial Theorem

(1 + x)n =n⇤

k=0

�n

k

⇥xk

Let x = �1.

# of subsets of S of odd sizes= # of subsets of S of even sizes

n�

k=0

�n

k

�= 2n

Page 28: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Assign m identical items to n distinct bins,each receiving ≤1 item.

�n

m

f : M1-1�� [n]

M: a “set” of m identical elements.

# of mappings

exactly k out of n bins are chosen to receive a ball

Page 29: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Gian-Carlo Rota (1932-1999)

The Twelvefold Way

Page 30: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

The twelvefold ways

f : N �M

|N | = n, |M | = m

N M f

n distinctobjects

m distinctobjects

m identicalobjects

n identicalobjects on-to

any function

1-1

Page 31: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

The twelvefold wayf : N �M |N | = n, |M | = m

elements of N

elements of M any f 1-1 on-to

distinct distinct

identical distinct

distinct identical

identical identical

Page 32: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Knuth’s exposition

balls per bin: unrestricted ≤ 1 ≥ 1

n distinct balls,m distinct bins

n identical balls,m distinct bins

n distinct balls,m identical bins

n identical balls,m identical bins

n balls are put into m binsf : N �M

mn (m)n

�m

n

�1 if n � m

0 if n > m�

1 if n � m

0 if n > m

Page 33: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integer

n beli k pirates

How many ways to assign n beli to k pirates?

How many ways to assign n beli to k pirates,so that each pirate receives at least 1 beli?

Page 34: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integern � Z+

k-composition of n:

an ordered sum of k positive integers

x1 + x2 + · · · + xk = n

a k-tuple (x1, x2, · · · , xk)xi � Z+and

Page 35: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integern � Z+

k-composition of n:

# of k-compositions of n?

n identical balls

� �

x1 x2 xk

��

n� 1k � 1

an ordered sum of k positive integers

Page 36: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integer

# of k-compositions of n?

�((x1, x2, . . . , xk)) = {x1, x1 + x2, x1 + x2 + x3,

. . . , x1 + x2 + · · · + xk�1}

� is a 1-1 correspondence between{k-compositions of n} and

�{1,2,...,n�1}k�1

x1 + x2 + · · · + xk = n

a k-tuple (x1, x2, · · · , xk)xi � Z+and

�n� 1k � 1

Page 37: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integer

weak k-composition of n:

an ordered sum of k nonnegative integers

# of weak k-compositions of n?�

n + k � 1k � 1

Page 38: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Compositions of an integer

weak k-composition of n:

# of weak k-compositions of n?

x1 + x2 + · · · + xk = n

a k-tuple (x1, x2, · · · , xk)and xi � N

(x1 + 1) + (x2 + 1) + · · · + (xk + 1) = n + k

a k-composition of n+k1-1 correspondence

�n + k � 1

k � 1

Page 39: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Multisets

k-subset of S“k-combination of Swithout repetition”

3-combinations of S = { 1, 2, 3, 4 }

without repetition:

{1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}

with repetition:{1,1,1}, {1,1,2}, {1,1,3}, {1,1,4}, {1,2,2}, {1,3,3}, {1,4,4}, {2,2,2}, {2,2,3}, {2,2,4}, {2,3,3}, {2,4,4}, {3,3,3}, {3,3,4}, {3,4,4}, {4,4,4}

Page 40: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Multisetsmultiset M on set S:

m : S � N

|M | =�

x�S

m(x)cardinality

m(x): # of repetitions of x in M

xmultiplicity of

“k-combination of Swith repetition”

k-multiset on S

��n

k

⇥⇥: # of k-multisets on an n-set

Page 41: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2011/comb1.pdfEnumerative Combinatorics, Volume 1 Alon and Spencer, The Probabilistic Method Jukna, Extremal Combinatorics: With Applications

Multisets��

n

k

⇥⇥=

k-multiset on S = {x1, x2, . . . , xn}

m(x1) + m(x2) + · · · + m(xn) = k

m(xi) � 0

a weak n-composition of k

�n + k � 1

n� 1

⇥=

�n + k � 1

k