22 Binomial Coefficients
22 Binomial Coefficients
CS/APMA 202
Rosen section 4.4
Aaron Bloomfield
1
Binomial Coefficients
It allows us to do a quick expansion of
( x+ y ) n
2
Review: corollary 1
from section 4.3
Let n and r be non-negative integers with
r ≤ n. Then C(n,r) = C(n,n-r)
Or, n n
r n r
n! n!
C (n, n r )
(n r )! n (n r ) ! r!(n r )!
3
Review: combinatorial proof
A combinatorial proof is a proof that uses
counting arguments to prove a theorem,
rather than some other method such as
algebraic techniques
4
Polynomial expansion
Consider (x+y)3: ( x y )3 x 3 3x 2 y 3 xy 2 y 3
Rephrase it as:
( x y )( x y )( x y ) x 3 x 2 y x 2 y x 2 y xy 2 xy 2 xy 2 y 3
5
Polynomial expansion
Consider ( x y ) 5 x 5 5 x 4 y 10 x 3 y 2 10 x 2 y 3 5 xy 4 y 5
To obtain the x5 term
Each time you multiple by (x+y), you select the x
Thus, of the 5 choices, you choose x 5 times
C(5,5) = 1
Alternatively, you choose y 0 times
C(5,0) = 1
To obtain the x4y term
Four of the times you multiply by (x+y), you select the x
The other time you select the y
Thus, of the 5 choices, you choose x 4 times
C(5,4) = 5
Alternatively, you choose y 1 time
C(5,1) = 5
To obtain the x3y2 term
C(5,3) = C(5,2) = 10
Etc… 6
Polynomial expansion
For (x+y)5
( x y )5 x 5 5 x 4 y 10 x 3 y 2 10 x 2 y 3 5 xy 4 y 5
5 5 5 4 5 3 2 5 2 3 5 4 5 5
( x y ) x x y x y x y xy y
5
5 4 3 2 1 0
7
Polynomial expansion:
The binomial theorem
For (x+y)n
n n 0 n n 1 1 n 1 n 1 n 0 n
( x y ) x y
n
x y x y x y
n n 1 1 0
n n 0 n n 1 1 n 1 n 1 n 0 n
x y x y x y x y
0 1 n 1 n
n
n n j j
x y
j 0 j
10
Pascal’s triangle
n= 0
8
11
Pascal’s Identity
By Pascal’s identity: 7 6 6 or 21=15+6
5 4 5
Let n and k be positive integers with n ≥ k.
Then n 1 n n
k k 1 k
or C(n+1,k) = C(n,k-1) + C(n,k)
The book calls this Theorem 2
We will prove this via two ways:
Combinatorial proof
Using the formula for n
k 12
Combinatorial proof of Pascal’s
identity
Prove C(n+1,k) = C(n,k-1) + C(n,k)
Consider a set T of n+1 elements
We want to choose a subset of k elements
We will count the number of subsets of k elements via 2 methods
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
16
Proof practice: corollary 1
Let n be a non-negative integer. Then
n
n
k 0 k
2 n
Algebraic proof n
n n j j
2 n (1 1) n ( x y ) x y
n
j 0 j
n
n k nk
1 1
k 0 k
n
n
k 0 k
17
Proof practice: corollary 1
Let n be a non-negative integer. Then n
n
k 0 k
2 n
Combinatorial proof
A set with n elements has 2n subsets
By definition of power set
Each subset has either 0 or 1 or 2 or … or n elements
n n
There are 0 subsets with 0 elements, 1 subsets with 1
element, … and nn subsets with n elements
Thus, the total number of subsets is
n
n
Thus, n
n
k 0 k
k
k 0
2 n
18
Pascal’s triangle
n= 0
8
20
Proof practice: corollary 2
Let n be a positive integer. Then (1) k n 0
n
k 0 k
Algebraic proof 0 0n
(1) 1
n
n
n
(1) k 1n k
k 0 k
n
n
(1) k
k 0 k
This implies that
n n n n n n
0 2 4 1 3 5 21
Proof practice: corollary 3
Let n be a non-negative integer. Then
n
n n
2 3
k
k 0 k
Algebraic proof
3n (1 2) n
n
n nk k
1 2
k 0 k
n
n k
2
k 0 k
22
Vandermonde’s identity
Let m, n, and r be non-negative integers
with r not exceeding either m or n. Then
m n r m n
r k 0 r k k
23
Combinatorial proof of
Vandermonde’s identity
Consider two sets, one with m items and one with n
items
m n
Then there are ways to choose r items from the union of
r
those two sets
Next, we’ll find that value via a different means
Pick k elements from the set with n elements
Pick the remaining r-k elements from the set with m elements
Via the product rule, there are r m k kn ways to do that for EACH
value of k r
m n
Lastly, consider this for all values of k: r k k
k 0
m n r m n
Thus,
r k 0 r k k
24
Review of Rosen, section
4.3, question 11 (a)
How many bit strings of length 10 contain
exactly four 1’s?
Find the positions of the four 1’s
The order of those positions does not matter
Positions 2, 3, 5, 7 is the same as positions 7, 5, 3, 2
Thus, the answer is C(10,4) = 210
25
Yet another combinatorial proof
Let n and r be non-negative integers with r ≤ n.
Then n 1 n j
r 1 j r r
The book calls this Theorem 4
Thus, n 1 n j
r 1 j r r
27
Rosen, section 4.4, question 24
Show that if p is a prime and k is an integer such that
1 ≤ k ≤ p-1, then p divides p
k
p p!
We know that k k!( p k )!
n
n
Consider each
of the possible k
2
subset sizes k
k 0 k
Choosing a subset of k
elements from a set of
Choosing one of n elements
the k elements in
the subset twice
30
Rosen, section 4.4, question 38
Two cases to show the right side: n(n-1)2n-2+n2n-1
Pick the same element from the subset
Pick that one element from the set of n elements: total of n possibilities
Pick the rest of the subset
As there are n-1 elements left, there are a total of 2 n-1 possibilities to pick a given
subset
We have to do both
Thus, by the product rule, the total possibilities is the product of the two
Thus, the total possibilities is n*2n-1
Pick different elements from the subset
Pick the first element from the set of n elements: total of n possibilities
Pick the next element from the set of n-1 elements: total of n-1 possibilities
Pick the rest of the subset
As there are n-2 elements left, there are a total of 2 n-2 possibilities to pick a given
subset
We have to do all three
Thus, by the product rule, the total possibilities is the product of the three
Thus, the total possibilities is n*(n-1)*2n-2
We do one or the other
Thus, via the sum rule, the total possibilities is the sum of the two
Or n*2n-1+n*(n-1)*2n-2
31
Quick survey
I felt I understood the material in this slide
set…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
32
Quick survey
The pace of the lecture for this slide set
was…
a) Fast
b) About right
c) A little slow
d) Too slow
33
Quick survey
How interesting was the material in this slide
set? Be honest!
a) Wow! That was SOOOOOO cool!
b) Somewhat interesting
c) Rather borting
d) Zzzzzzzzzzz
34
Becoming an IEEE author
35
36