Download Lecture 4: Combinations, Subsets and Multisets

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

List of important publications in mathematics wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Non-standard calculus wikipedia , lookup

Laws of Form wikipedia , lookup

Brouwer fixed-point theorem wikipedia , lookup

Four color theorem wikipedia , lookup

Addition wikipedia , lookup

Mathematical proof wikipedia , lookup

Fundamental theorem of calculus wikipedia , lookup

Wiles's proof of Fermat's Last Theorem wikipedia , lookup

Fermat's Last Theorem wikipedia , lookup

Non-standard analysis wikipedia , lookup

Elementary mathematics wikipedia , lookup

Theorem wikipedia , lookup

Birkhoff's representation theorem wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Order theory wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
Part 4
Combinations
Combinations, Subsets and Multisets
Printed version of the lecture Discrete Mathematics on 14. September 2010
Tommy R. Jensen, Department of Mathematics, KNU
4.1
Contents
1
Combinations of Sets
1
2
Formulas for Combinations
1
3
The Binomial Theorem
4
4
Permutations of Multisets
5
5 r-Combinations of Multisets
6
6
8
Conclusion
4.2
1
Combinations of Sets
Combinations and subsets
Combination of a set S
Let r be an integer, with r ≥ 0.
An r-combination of S is a selection of r different elements of S in no particular order.
An r-subset of S is a set of r different elements of S.
An r-combination is really the same as an r-subset.
Usually we will just say ‘r-subset’, except when we want to talk about the way in which the elements
are being chosen.
4.3
2
Formulas for Combinations
Definition
1
The number of different r-subsets of a set with n elements is
n
r
pronounced n choose r.
4.4
For any numbers n and r with 0 ≤ r ≤ n,
n
P(n, r) = r!
,
r
and
n
n!
=
.
r
r!(n − r)!
4.5
Pascal’s Formula
For any numbers n and r with 0 < r ≤ n,
n
n−1
n−1
=
+
.
r
r
r−1
Blaise Pascal with triangle
4.6
Pascal’s Formula
Proof
Let S be a set of n elements, n > 0, and choose x ∈ S.
Let X be the set of all r-subsets of S.
Partition X into two subsets X1 , X2 as follows:
X1 consists of the r-subsets of S that contain x,
X2 consists of the r-subsets that do not contain x.
2
S \ {x} is the set of the n − 1 elements of S different from x.
An r-subset from X1 is given by choosing an (r − 1)-subset of S \ {x}, and then add x to it as element
number r.
So the number of possible choices is n−1
r−1 for elements of X1 .
An r-subset fromX2 is the same as an r-subset of S \ {x}.
So there are n−1
choices for elements of X2 .
r
The sum rule gives us
n
n−1
n−1
= |X| = |X1 | + |X2 | =
+
.
r
r−1
r
4.7
Formula for all subsets
For any number n,
n
n
n
n
+
+
+···+
= 2n .
0
1
2
n
Proof
Each side of the equality sign is the number of subsets of a set S of n elements.
On the left side, the sum rule is used: partition the subsets of S into parts that are the sets of subsets of
S with r elements, for r = 0, 1, 2, . . . , n.
On the right side, the product rule is used: a subset of S is chosen by deciding for each of the n elements
x in S whether x is in the subset or not; for each x there are 2 choices. So there are 2n choices of a subset
altogether.
4.8
Formula for the 2-subsets
Example
Let X be the set of 2-subsets {i, j} of {1, 2, . . . , n}, where 1 ≤ i < j ≤ n.
n(n−1)
Then X has n2 = 2 elements.
Partition X into subsets X1 , X2 , . . . , Xn where X j has the sets {i, j} with i < j as its elements.
Then |X j | = j − 1 for each j, since i can be chosen only from the set {1, 2, . . . , j − 1}.
Using the sum rule |X1 | + |X2 | + · · · + |Xn | = |X| we have a proof of
0 + 1 + 2 + · · · + (n − 1) =
n(n − 1)
.
2
4.9
3
3
The Binomial Theorem
Binomial coefficients in algebra
Theorem 1.1
Let n be an integer such that n > 0. Then
n n−1
n n−2 2
n
(x + y)n = xn +
x y+
x y +···+
xyn−1 + yn
1
2
n−1
n n n−k k
x y .
=∑
k=0 k
This identity is called the Binomial Theorem.
4.10
Proof of Theorem 1.1
Lemma
n
∏(xi + yi ) =
i=1
( ∏ x j )( ∏ yk ).
∑
S⊆{1,2,...,n} j∈S
k∈S̄
Example: (x1 + y1 )(x2 + y2 )(x3 + y3 ) =
x1 x2 x3 + x1 x2 y3 + x1 y2 x3 + x1 y2 y3 + y1 x2 x3 + y1 x2 y3 + y1 y2 x3 + y1 y2 x3 + y1 y2 y3 .
Proof of Lemma by induction on n, the base of induction
For n = 1 : the statement is
x1 + y1 = ∑ ( ∏ x j )( ∏ yk )
S⊆{1} j∈S
=(
x j )( ∏ yk ) + ( ∏ x j )(
∏
j∈0/
k∈0/
j∈{1}
k∈S̄
yk ) = x1 · 1 + 1 · y1 = x1 + y1 ,
∏
k∈{1}
which is true.
4.11
Proof of Lemma by induction on n, the induction step
Assume n > 1, and
n−1
∏ (xi + yi ) =
i=1
( ∏ x j )( ∏ yk ).
∑
S⊆{1,2,...,n−1} j∈S
k∈S̄
Then ∏ni=1 (xi + yi ) =(∏n−1
i=1 (xi + yi ))(xn + yn )
=
∑
( ∏ x j )( ∏ yk )(xn + yn )
∑
( ∏ x j )( ∏ yk )xn + ( ∏ x j )( ∏ yk )yn
S⊆{1,2,...,n−1} j∈S
=
k∈S̄
S⊆{1,2,...,n−1} j∈S
=
∑
(
∑
k∈S̄
x j )( ∏ yk ) + ( ∏ x j )(
∏
S⊆{1,2,...,n−1} j∈S∪{n}
=
j∈S
k∈S̄
j∈S
k∈S̄
∏
yk )
k∈S̄∪{n}
( ∏ x j )( ∏ yk )
T ⊆{1,2,...,n} j∈T
k∈T̄
4.12
Proof of Theorem 1.1
From the Lemma we have
n
∏(xi + yi ) =
i=1
∑
( ∏ x j )( ∏ yk ).
S⊆{1,2,...,n} j∈S
k∈S̄
Let x = x1 = x2 = · · · = xn and y = y1 = y2 = · · · = yn .Then
n
∏(xi + yi ) = (x + y)n ,
i=1
and
∑
( ∏ x j )( ∏ yk )
S⊆{1,2,...,n} j∈S
=
∑
( ∏ x)( ∏ y)
∑
x|S| yn−|S|
S⊆{1,2,...,n} j∈S
k∈S̄
=
k∈S̄
S⊆{1,2,...,n}
n
=
4
n i n−i
xy .
i=0 i
∑
4.13
Special case of the Binomial Theorem
Let n be a positive integer. Then
(1 + x)n =
n
n k
x .
k=0 k
∑
4.14
An application of the Binomial Theorem
Subsets of even and odd size
Let x = 1 and y = −1 in the Binomial Theorem:
0 = (1 − 1)n =
n
n
n
n
n
n
(−1)n−1 +
(−1)n ,
−
+
−
+···+
0
1
2
3
n−1
n
so
n
n
n
n
n
n
+
+
+··· =
+
+
+···
0
2
4
1
3
5
We have proved:
In a nonempty set, the number of subsets of even size is the same as the number of subsets of odd size.
4.15
Another identity
n
∑k
k=1
n
n
n
n
n
=
+2
+3
+···+n
= n2n−1 .
k
1
2
3
n
Proof.
We know
(1 + x)n =
n
n
∑ k xk .
k=0
Differentiate both sides with respect to x :
n(1 + x)n−1 =
n
n
kxk−1 .
k=0 k
∑
For x = 1 we get
n2n−1 =
n
n n
n
k
=
∑ k
∑k k .
k=0
k=1
4.16
4
Permutations of Multisets
r-permutations of multisets
Definition
In a multiset S, each element can appear more than one time.
An r-permutation of S is an ordered sequence of r of the elements of S, possibly with repetition.
If S has n elements, then an n-permutation is called a permutation of S.
Example: The multiset S = {a, a, b, c, c, c} is also written as {2 · a, 1 · b, 3 · c}. It has size 6.
Some different 3-permutations of S :
aab
aba
cba
ccc
4.17
5
r-Permutations of infinite multisets
If S is a multiset with k different elements, and each element appears inifinitely many times, then the number
of r-permutations of S is
kr .
Proof
To choose an r-permutation, there are r choices to make, each time choosing one of the k different elements.
Since each element appears infinitely often, it can always be chosen.
So in each choice there are exactly k possibilities. The product rule implies that there are kr different
choices of an r-permutation.
4.18
Permutations of finite multisets
Let S be a multiset with k different elements that appear n1 , n2 , . . . , nk times, respectively.
The size of S is n = n1 + n2 + · · · + nk .
Then the number of permutations of S is equal to
n!
.
n1 !n2 ! · · · nk !
Proof idea
First think of a set S0 having n different elements:
Instead of ai that appears ni times in S, the new set S0 has elements (ai )1 , (ai )2 , . . . , (ai )ni .
Then we know that there are P(n, n) = n! permutations of S0 .
There are ni ! different permutations of (ai )1 , (ai )2 , . . . , (ai )ni that put the ai in the same places of the
ordering of S.
So there are n1 !n2 ! · · · nk ! different permutations of S0 that produce the same permutation of S.
Therefore the number of permutations of S is n1 !n2n!!···nk ! .
4.19
5 r-Combinations of Multisets
r-Combinations of multisets
Definition
An r-combination of a multiset S is a selection of size r from S, with no concern for order.
This can also be called an r-submultiset.
Example: the 2-combinations of S = {a, a, b, c, c, c} are
{a, a}
{a, b}
{a, c}
{b, c}
{c, c}
4.20
6
r-Combinations of multisets
Let S be a multiset with k different elements, each appearing infinitely many times.
Then the number of r-combinations of S is equal to
r+k−1
.
r
We change the problem into a simpler problem in two steps, before we solve it.
4.21
Step 1
Change the problem into counting solutions to an equation
Let a1 , a2 , . . . , ak be the k different elements of S, each appearing infinitely many times in S.
We want to know how many ways there are to choose a1 some number n1 of times, with n1 ≥ 0 a2
some number n2 of times, with n2 ≥ 0 . . . ak some number nk of times, with nk ≥ 0 so that the sum
n1 + n2 + · · · + nk is equal to r.
We want to know the answer to:
How many solutions are there to the equation
n1 + n2 + · · · + nk = r
with integer numbers n1 , n2 , . . . , nk ≥ 0?
4.22
Step 2
Change the equation to another equation
How many solutions are there to the equation
n1 + n2 + · · · + nk = r
with integer numbers n1 , n2 , . . . , nk ≥ 0?
It is the same number as the number of solutions to
(n1 + 1) + (n2 + 1) + · · · + (nk + 1) = r + k
with integer numbers n1 , n2 , . . . , nk ≥ 0.
So it is also the same as the number of solutions to
x1 + x2 + · · · + xk = r + k
with integer numbers x1 , x2 , . . . , xk > 0.
4.23
7
Solution to the problem
What is the number of solutions x1 , x2 , . . . , xk > 0? to
x1 + x2 + · · · + xk = r + k?
Place r + k coins in a long row:
◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦◦
Find a solution x1 , x2 , . . . , xk > 0 by choosing k − 1 of the r + k − 1 spaces between two coins:
◦ ◦ | ◦ | ◦ ◦ ◦ ◦ ◦ ◦| ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦| ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ | ◦ ◦ ◦ ◦
dividing the r + k coins into k sections; in section number i from left to right we count xi > 0 coins.
All solutions x1 , x2 , . . . , xk > 0 can be described in this way. So their number is the same as the number
of choices of k − 1 of the r + k − 1 spaces between the r + k coins:
r+k−1
r+k−1
=
.
k−1
r
4.24
6
Conclusion
Conclusion
This ends the lecture!
4.25
Next time:
Logic
4.26
8