3.
Combinatorial counting
Question: How many distinct 5-letter words using 26 alphabets? (ex: ywizp)
[Proposition 3.1.1] Let n, m be positive integers.
Let N be an n-element set, and let M be an m-element set.
n
Then the number of all possible mappings f : N → M is m .
You can practice rigorous mathematical proofs in a simple situation.
[Proposition 3.1.1] Let n, m be positive integers.
Let N be an n-element set, and let M be an m-element set.
n
Then the number of all possible mappings f : N → M is m .
PF) We prove by induction on n.
This is clear when n = 1.
Assume that n ≥ 2. Let a ∈ N.
The function from N to M consists of a function from N∖{a} to M
and a function from {a} to M.
n−1
The number of former functions is m and the number of latter ones is m.
n−1 n
Thus, m ⋅m=m .
n
[Proposition 3.1.2] Any n-element set X has exactly 2 subsets.
PF) We can prove by induction on n.
Or, for a subset A ⊆ X, we can define a function fA : X → {0,1} such that
fA(x) = 1 if x ∈ A and 0 otherwise.
There is one-to-one correspondence between
{ all subsets of X } and { all possible functions f : X → {0,1} }
n
Thus, the total number is 2 by Proposition 3.1.1.
[Proposition 3.1.3] Let n be a positive integer.
n−1 n−1
Each n-element set has exactly 2 subsets of odd size and 2 subsets of even size.
PF) We use Prop 3.1.2. Let X be the set and let a ∈ X.
Any subset A ⊆ X∖{a} can be completed to a subset A′ ⊆ X of odd size,
by the following rule :
if | A | is odd, then A′ = A, and if | A | is even, then A′ = A ∪ {a}.
This mapping is a bijection.
n−1
Thus, the number of subsets of X of odd size is 2 .



[Proposition 3.1.4] Let n, m be positive integers with n ≤ m.
The number of one-to-one mappings of an n-element set to an m-element set is
n−1
∏
(m − i) = m(m − 1)⋯(m − n + 1).
i=0
Remark:
There are two variables.
We need to choose some variable which is good for induction.
If you ask me how.. , well you need to understand the behind idea and decide.
Sometimes, we really need to apply induction on two variables a and b.
Even though we apply for two variables, we can say that
‘we prove by induction on a + b’, where you can apply hypothesis for smaller a + b.
But this is not necessary here.
[Proposition 3.1.4] Let n, m be positive integers with n ≤ m.
The number of one-to-one mappings of an n-element set to an m-element set is
n−1
∏
(m − i) = m(m − 1)⋯(m − n + 1).
i=0
PF) We prove by induction on n.
For n = 1, the number of possibilities is m. Thus holds.
We assume that n ≥ 2, and assume that it holds with smaller n and all m.
Consider an n-element set N and m-element set M. Let a ∈ N and choose f(a).
It remains to choose a one-to-one mapping from N∖{a} to M∖{f(a)}.
By induction, there are (m − 1)(m − 2)⋯(m − n + 1) possibilities.
So, in total, there are m(m − 1)⋯(m − n + 1) possibilities.
Permutations
A bijective mapping from a finite set X to itself is called a permutation of X.
For example, X = {a, b, c, d} with p(a) = b, p(b) = d, p(c) = c and p(d) = a.
(b d c a)
a b c d
Traditionally, we represent it as
In the first row, we list the elements of X, and
in the second row, we write p(x).
The number of permutations on n elements is n(n − 1)⋯2 ⋅ 1 by Proposition 3.1.4.
We write n! = n(n − 1)⋯2 ⋅ 1
Binomial coefficients
Let n, k be non-negative integers with n ≥ k.
(k)
n
The binomial coefficient (read n choose k) is defined by
(k)
n n(n − 1)⋯(n − k + 1) n!
= =
k(k − 1)⋯1 k!(n − k)!
(k)
n
The basic combinatorial meaning of is
the number of k-element subsets of an n-element set.
(k)
X
For a set X, we define as the set of all k-element subsets of X.
[Proposition 3.3.2] Let k ∈ ℕ.
( k )
|X|
For a finite set X, the number of all k-element subsets is exactly .
PF) Let n = | X | . We count all ordered k-tuples of elements of X in two ways.
By Proposition 3.1.4, the number of ordered k-tuples is n(n − 1)⋯(n − k + 1).
(k)
X
On the other hand, from one k-element subset M ∈ ,
we can create k! distinct ordered k-tuples.
(k) (k) ( k )
X X |X|
Hence, n(n − 1)⋯(n − k + 1) = k! . So, = .
How many ways are there to write a non-negative integer m as a sum of r non-negative
integers as a1 + a2 + ⋯ + ar = m ?
( r−1 )
m+r−1
The answer is .
Well-known equalities :
( k ) (n − k)
n n
(1) =
(k − 1) ( k ) (k)
n−1 n−1 n
(2) + =
[Theorem 3.3.3 (Binomial thm)] Let n be a non-negative integer.
∑ (k)
n
n n k
(1 + x) = x.
k=0
PF) We prove by induction on n.
If n = 1, then both sides are 1 + x.
Assume that n ≥ 2.
By the induction hypothesis,
∑( k )
n−1
n−1 n − 1 k
(1 + x) = x
k=0
n n−1
PF) (1 + x) = (1 + x) (1 + x)
∑( k )
n−1
n−1 k
= (1 + x) ⋅ x
k=0
∑( k ) ∑( k )
n−1 n−1
n−1 k n − 1 k+1
= x + x
k=0 k=0
∑( k ) ∑ (k − 1)
n−1 n
n−1 k n−1 k
= x + x
k=0 k=1
∑ (( k ) ( k − 1 ))
n−1
n−1 n−1 k n
=1+ + x +x
k=1
∑ (k) ∑ (k)
n−1 n
n k n n k
=1+ x +x = x.
k=1 k=0
[Theorem 3.3.3 (Binomial thm)] Let n be a non-negative integer.
∑ (k)
n
n n k
(1 + x) = x.
k=0
∑ (k)
n
n n k n−k
You can easily modify to (x + y) = xy
k=0
∑(i) (n)
n 2
n 2n
[Proposition 3.3.4] = .
i=0
PF) The firs trick is to rewrite the sum using the symmetry of binomial coefficients.
∑(i) ∑ ( i )( n − i )
n 2 n
n n n
= .
i=0 i=0
This sum expresses the number of n-element subsets of a 2n-element set.
Consider a 2n-element set X and divide into n-element disjoint subsets X1 and X2.
We first pick i elements from X1 and then n − i elements from X2.
The number of possibilities is exactly the number of n-element subsets of X.
[Theorem 3.3.5 (Multinomial theorem)]
Let n be a positive integer and x1, …, xm ≥ 0 be real.
( k1, k2, …, km )
n
n n k1 k2 km
∑
(x1 + x2 + ⋯ + xm) = x1 x2 ⋯xm
k +⋯+k =n,k ≥0
1 m i
( k1, k2, …, km ) k1 !k2 !⋯km !
n n!
= with k1 + k2 + ⋯ + km = n.
This can be proved by induction on n (Ex 26)