MORE Counting
CS 30 : Discrete Mathematics for Computer Science First Semester, AY 2012-2013
https://sites.google.com/a/dcs.upd.edu.ph/nhsh_classes/cs 30
sablay-logo
Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman nshernandez@dcs.upd.edu.ph updilseal
Day 13
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
MORE Counting
Combinatorics and Computing
sablay-logo
1
MORE Counting Pascal's Identity and the Binomial Theorem Catalan Numbers
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Pascal's Identity
Let and be positive integers with Then n
Pascal's Identity and the Binomial Theorem
MORE Counting
r
Catalan Numbers
≼r
n
1
. 1
( , ) + C (n, r − ) = C (n + , r )
C n r
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Pascal's Identity
Let and be positive integers with Then n
Pascal's Identity and the Binomial Theorem
MORE Counting
r
Catalan Numbers
≼r
n
1
. 1
( , ) + C (n, r − ) = C (n + , r )
C n r
Prove this!
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial.
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial. Binomial expansion for n = 2: used by (Greek mathematician) Euclid
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial. Binomial expansion for n = 2: used by (Greek mathematician) Euclid for higher natural numbers: credited to (Arab mathematician) Omar Khayyam
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial. Binomial expansion for n = 2: used by (Greek mathematician) Euclid for higher natural numbers: credited to (Arab mathematician) Omar Khayyam for negative integral and fractional indices: generalized by (British scientist) Isaac Newton
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial. Binomial expansion for n = 2: used by (Greek mathematician) Euclid for higher natural numbers: credited to (Arab mathematician) Omar Khayyam for negative integral and fractional indices: generalized by (British scientist) Isaac Newton
sablay-logo
Theorem Let n be a positive integer. Then for all x and y ,
(x + y )n
= =
C (n, 0)x n + C (n, 1)x n−1 y + C (n, 2)x n−2 y 2 + · · · + C (n, n)y n n P C (n, r )x n−r y r r =0
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
The Binomial Theorem
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
The binomial theorem is de ned as a formula for the power of a binomial. Binomial expansion for n = 2: used by (Greek mathematician) Euclid for higher natural numbers: credited to (Arab mathematician) Omar Khayyam for negative integral and fractional indices: generalized by (British scientist) Isaac Newton
sablay-logo
Theorem Let n be a positive integer. Then for all x and y ,
(x + y )n
= =
C (n, 0)x n + C (n, 1)x n−1 y + C (n, 2)x n−2 y 2 + · · · + C (n, n)y n n P C (n, r )x n−r y r r =0
updilseal
Prove this by mathematical induction! dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Pascal's Identity and the Binomial Theorem
MORE Counting
The Pascal's Triangle and The Binomial Coe cients Catalan Numbers
n=0
1
n=1
1
n=2
1
1
n=3
1
n=4
1
n=5
1
n=6
1
2 3
3
4 5
6
1
6 10
15
sablay-logo
1 4
10 20
1 5
15
1 6
1 updilseal
n=7 n=8
1 1
7 8
21 28
35 56
Discrete Mathematics for Computer Science
35 70
CS 30
21 56
7 28
1 8
1
dcs-logo
acl-logo
Pascal's Identity and the Binomial Theorem
MORE Counting
The Pascal's Triangle and The Binomial Coe cients Catalan Numbers
0 0
“ ”
1 0
“ ”
2 0
“ ”
3 0
“ ”
4 0
“ ”
5 0
“ ”
6 0
“ ”
7 0
“ ”
8 0
“ ”
8 1
“ ”
7 1
“ ”
6 1
“ ”
8 2
“ ”
5 1
“ ”
7 2
“ ”
4 1
“ ”
6 2
“ ”
8 3
“ ”
3 1
“ ”
5 2
“ ”
7 3
“ ”
2 1
“ ”
4 2
“ ”
6 3
“ ”
8 4
“ ”
sablay-logo
1 1
“ ”
3 2
“ ”
“ ”
“ ”
5 3
“ ”
7 4
“ ”
2 2
“ ”
4 3
“ ”
6 4
“ ”
8 5
“ ”
3 3
“ ”
5 4
“ ”
7 5
“ ”
4 4
“ ”
6 5
“ ”
8 6
“ ”
5 5
“ ”
7 6
“ ”
6 6
8 7
7 7
“ ”
8 8
“ ”
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Examples
1
2
3
Pascal's Identity and the Binomial Theorem
MORE Counting
What is the expansion of (
x
What is the coe cient of What is the coe cient of
x
x
Catalan Numbers
+ y )4
12
12
y
y
?
sablay-logo
13
in the expansion of (
13
in the expansion of (2
+ y )25
x
x
−
3
y
?
)25
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
Vandermonde's Identity Let , and be nonnegative integers with not exceeding either or . Then X r m
n
r
r
m
sablay-logo
n
m
+n r
=
k =0
r
m
n
−k
k
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
Vandermonde's Identity Let , and be nonnegative integers with not exceeding either or . Then X r m
n
r
r
m
sablay-logo
n
m
+n r
=
k =0
r
m
n
−k
k
Prove this! updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Diagonal-Avoiding Paths
MORE Counting
Pascal's Identity and the Binomial Theorem Catalan Numbers
In an Ă— grid, how many paths are there of length 2 that lead from the lower left corner to the upper right corner that do not cross the diagonal line from lower left to upper right? In other words, how many paths stay on or below the main diagonal? n
n
n
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Diagonal-Avoiding Paths
Pascal's Identity and the Binomial Theorem
MORE Counting
Catalan Numbers
In an × grid, how many paths are there of length 2 that lead from the lower left corner to the upper right corner that do not cross the diagonal line from lower left to upper right? In other words, how many paths stay on or below the main diagonal? n
n
n
Catalan Number The th Catalan number, n , (the total number of diagonal-avoiding paths through an n × n grid) is given by 2 − 2 = 1 2 = n +1 +1 n
sablay-logo
C
C
n
n
n
n
n
n
n
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
Diagonal-Avoiding Paths
Pascal's Identity and the Binomial Theorem
MORE Counting
Catalan Numbers
In an × grid, how many paths are there of length 2 that lead from the lower left corner to the upper right corner that do not cross the diagonal line from lower left to upper right? In other words, how many paths stay on or below the main diagonal? n
n
n
Catalan Number The th Catalan number, n , (the total number of diagonal-avoiding paths through an n × n grid) is given by 2 − 2 = 1 2 = n +1 +1 More on Catalan Numbers n
sablay-logo
C
C
n
n
n
n
n
n
n
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo
MORE Counting
Questions? See you next meeting!
sablay-logo
updilseal
dcs-logo
Discrete Mathematics for Computer Science
CS 30
acl-logo