1
CSE 20 Lecture 15
Analysis: Inclusion-
Exclusion Technique
CK Cheng

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
2
Analysis: Inclusion
–
Exclusion Principle
Ex: A bakery makes only M=3 kinds
of cookies. Find the number of ways
a person can buy r=4 of the cookies.
x+y+z = 4 (each variable represents
the cookie in that flavor)
C(4+2, 2) = (6*5)/2!= 15
(C(n +m-1, m-1),
n = #cookies,
m = #kinds of cookies)
X Y Z
0 0 4
0 1 3
0 2 2
0 3 1
0 4 0
1 0 3
1 1 2
…
…
…