排列与组合
排列与阶乘
The arrangement of different objects into a linear order using each object exactly once is called a permutation of these objects.
There are n choices for the first place.
We have n-1 choices for the second place.
We have n-2 choices for the third place.
\cdots\cdots
There is only one choice for the last place.
The number n\cdot(n-1)\cdot(n-2)\cdots 2\cdot 1 of all permutations of n objects is called n factorial, and is denoted by n!.
Define 0!=1.
Theorem 1 The number of all permutations of an n-element set is n!.
Stirling’s formula
n! \sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n
Exercise 1 A gardener has 3 blue flowers, 4 red flowers and 5 white flowers to plant in a row. In how many different ways can she do that?
Let n, k,a_1,a_2, \cdots, a_k be non-negative integers satisfying a_1 + a_2 + \cdots + a_k = n. Consider a multiset of n objects, in which a_i objects are of type i, for all i \in [k]. Then the number of ways to linearly order these objects is
\frac{n!}{a_1!a_2!\cdots a_k!}
字符串
Next, we construct strings, or words, from a finite set of symbols, which we call a finite alphabet.
We will not require that each symbol occur a specific number of times.
Theorem 2 The number of k-digit strings one can form over an n-element alphabet is n^k.
Exercise 2 How many 6-digit positive integers are there in decimal system?
For a pairing between X and Y to be a bijection, four properties must hold:
each element of X must be paired with at least one element of Y,
no element of X may be paired with more than one element of Y,
each element of Y must be paired with at least one element of X, and
no element of Y may be paired with more than one element of X.
Satisfying properties (1) and (2) means that a map is a function with domain X.
Functions which satisfy property (3) are said to be “onto Y” and are called surjections.
Functions which satisfy property (4) are said to be “one-to-one functions” and are called injections.
Example 1 The number of all subsets of an n-element set is 2^n.
Let B be any subset of [n], and let f(B) be the string whose i-th digit is 1 if and only if {i \in B} and 0 otherwise.
The latter set has 2^n elements.
Suppose n=9.
B=\{1,3,5,6\}\,\Leftrightarrow\,f(B)='101011000'
B=\{2,5,7,9\}\,\Leftrightarrow\,f(B)='010010101'
Theorem 3 Let n and k be positive integers satisfying n > k. Then the number of k-digit strings over an n-element alphabet in which no letter is used more than once is
P(n,k)=n(n-1)\cdots(n-k+1)=\frac{n!}{(n-k)!}
These objects are also known as \mathbf{k}-permutations of \mathbf{n}, or partial permutations.
Example 2 There are 10 boxes in different colors. In how many different ways can each of Jack, Rose, Smith, Hilary, and Jessica choose one box from them?
P(10,5)=\frac{10!}{5!}
组合
A k-element combination of an n-set S is a k element subset of S, the elements of which are not ordered.
For example, choose 5 cards from a suit to form a particular hand.
{n \choose k}=\frac{n(n-1)\cdots(n-k+1)}{k(k-1)\cdots 1}=\frac{n!}{(n-k)!k!}
Theorem 4 For all non-negative integers k < n, {n \choose k}={n \choose n-k} hold. And {n \choose 0}={n \choose n}=1.
Exercise 3 A worker has to work for 6 days in May.
However, he is not allowed to work two consecutive days.
In how many different ways can he choose the 6 days he will work?
Exercise 4 Assume that we play a lottery game where 5 numbers are drawn out of [100], but the numbers drawn are put back.
To win the jackpot, one must have played the same multiset of numbers as the one drawn (regardless of the order).
How many lottery tickets do we have to buy to make sure that we win the jackpot?
(5,93,66,34,66 is the same as 66,66,34,93,5.)
Theorem 5 The number of \mathbf{k}-element multisets whose elements all belong to [n] is {n+k-1 \choose k}
The \mathbf{k}-element combination is also known as binomial coefficients.
二项式系数
Theorem 6 For all non-negative integer n,
(x+y)^n =\sum_{k=0}^n {n \choose k} x^{n-k} y^k. write (x + y)^n as a product (x+y)(x+y)(x+y)\cdots(x+y). There will be one term in the expansion for each choice of either x or y. The binomial coefficient {n \choose k} can be interpreted as the number of ways to choose k elements from an n-element set.
Example 3 The coefficient of xy^2 in
\begin{gather} (x+y)^3 = (x+y)(x+y)(x+y) \\ = xxx + xxy + xyx + \boxed{xyy} + yxx + \boxed{yxy} + \boxed{yyx} + yyy \\ = x^3 + 3x^2y + \boxed{3xy^2} + y^3. \end{gather} \,
equals \binom{3}{2}=3.
Theorem 7 Let n > 0,
\sum_{k=0}^n (-1)^k\binom n k = 0.
Proof. (1-1)^n =\sum_{k=0}^n {n \choose k} 1^{n-k} (-1)^k.\square
Theorem 8 \sum_{k=0}^n \binom n k = 2^n
Proof. (1+1)^n =\sum_{k=0}^n {n \choose k} 1^{n-k} 1^k.\square
Recursive formula
\binom nk = \binom{n-1}{k-1} + \binom{n-1}k for all integers n,k : 1\le k\le n-1, with initial values
\binom n0 = \binom nn = 1 \quad \text{for all integers } n\ge0.
Exercise 5 Try to prove the recursive formula:
\binom nk = \binom{n-1}{k-1} + \binom{n-1}k.
Combinatorial proof of Recursive formula.
The left-hand side is the number of k-element subsets of [n].
Such a subset S either contains n, or not.
If it does, then the rest of S is a k-1-element subset of [n-1], and these are counted by the first part of the right-hand side.
If it does not, then S is a k-element subset of [n-1], and these are enumerated by the second part of the right-hand side.
Recursive formula also gives rise to Yanghui’s triangle:
\begin{array}{c} \{1\} \\ \{1,1\} \\ \{1,2,1\} \\ \{1,3,3,1\} \\ \{1,4,6,4,1\} \\ \{1,5,10,10,5,1\} \\ \{1,6,15,20,15,6,1\} \\ \{1,7,21,35,35,21,7,1\} \\ \end{array}
Exercise 6 Try to prove using mathematical induction:
\sum_{m=k}^n \binom m k = \binom {n+1}{k+1}.
Theorem 9 Hockey-stick identity \sum_{m=k}^n \binom m k = \binom {n+1}{k+1}.
Proof. Combinatorial proof.
The right-hand side counts the number of (k+1)-element subsets of [n + 1].
That is, there are \binom nk subsets of [n+1] that have k+1 elements whose largest element is n+1.
There are \binom {k+i}k subsets of [n + 1] that have k+1 elements whose largest element is k+i+1. \square
Exercise 7 Try to prove: for all non-negative integers n,
\sum_{k=0}^n k \binom n k = n 2^{n-1}.
Theorem 10 \sum_{k=0}^n k \binom n k = n 2^{n-1}.
Proof. Combinatorial proof.
Choose a committee among n people, then to choose a president from the committee.
Left-hand side: we first choose a k-member committee in \binom nk ways, then we choose its president in k ways.
Right-hand side: we first choose the president in n ways, then we choose a subset of the remaining n-1-member set of people for the role of non-president committee members in 2^{n-1} ways. \square
Theorem 11 Chu–Vandermonde identity For any complex-values m and n and any non-negative integer k, \sum_{j=0}^k \binom m j \binom{n-m}{k-j} = \binom n k
Proof. Combinatorial proof.
Right-hand side: all k-element subsets of [n].
Left-hand side: We can first choose j elements from [m] in \binom mj ways, then choose the remaining k-j elements from the set \{m+1, m+2, \cdots , n\} in \binom{n-m}{k-j} ways. \square
Theorem 12 For all non-negative integers k and n, such that k \leq \frac{n-1}{2}, the inequality \binom{n}{k}\leq\binom{n}{k+1} holds. Furthermore, equality holds if and only if n = 2k + 1.
\frac{n!(\boxed{k+1})}{(k+1)!(n-k)!}\qquad\qquad\frac{n!(\boxed{n-k})}{(k+1)!(n-k)!}
Corollary 1 For all non-negative integers k and n, such that k \geq \frac{n-1}{2}, the inequality \binom{n}{k}\geq\binom{n}{k+1} holds. Furthermore, equality holds if and only if n = 2k + 1.
多项式系数
Multinomial coefficients
The third power of the trinomial x + y + z is given by
(x+y+z)^3
= x^3 + y^3 + z^3 + 3 x^2 y + 3 x^2 z + 3 y^2 x
+ 3 y^2 z + 3 z^2 x + 3 z^2 y + 6 x y z.
Binomial coefficients can be generalized to multinomial coefficients defined to be:
{n\choose a_1,a_2,\cdots,a_k} =\frac{n!}{a_1!a_2!\cdots a_k!}
where \sum_{i=1}^ka_i=n.
(x_1 + x_2 + \cdots + x_k)^n
= \sum_{a_1+a_2+\cdots+a_k=n} {n \choose a_1, a_2, \ldots, a_k} \prod_{1\le i\le k}x_{i}^{a_{i}},
The case k = 2 gives binomial coefficients:
{n\choose a_1,a_2}={n\choose a_1, n-a_1}={n\choose a_1}= {n\choose a_2}.
Theorem 13 For all non-negative integers n and a_1,a_2,\cdots,a_k such that \sum_{i=1}^ka_i=n.
{n \choose a_1, a_2, \ldots, a_k}={n \choose a_1}{n-a_1\choose a_2}\cdots{n-a_1-\cdots-a_{k-1}\choose a_k}
Proof. {n \choose a_1}{n-a_1\choose a_2}\cdots{n-a_1-\cdots-a_{k-1}\choose a_k}=
\frac{n!}{\boxed{(n-a_1)!}a_1!}\frac{\boxed{(n-a_1)!}}{\boxed{(n-a_1-a_2)!}a_2!}\frac{\boxed{(n-a_1-a_2)!}}{(n-a_1-a_2-a_3)!a_3!}\cdots\square