CSE20 Lecture 15 - CSE 20 Lecture 15 Analysis:...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 20 Lecture 15 Analysis: Inclusion- Exclusion Technique CK Cheng
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
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 … … …
Background image of page 2
3 Cont. (from last slide) Ex: Buy 2 cookies out of 3 flavors x+y+z = 2 C(2+2, 2) = C(4,2) = (4*3)/2! = 6 Id X Y Z 0 0 0 2 1 0 1 1 2 0 2 0 3 1 0 1 4 1 1 0 5 2 0 0
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Cont. (from last slide) Ex: Buy 8 cookies out of 4 kinds of flavors. x 1 +x 2 +x 3 +x 4 = 8 C(8+3,3)=11!/(8!3!)=(11*10*9)/3!=165. Ex: Buy 20 cookies out of 5 kinds of flavors. x 1 +x 2 +x 3 +x 4 +x 5 = 20 C(20+4,4)=24!/(20!4!)=(24*23*22*21)/4!
Background image of page 4
5 Ex: Possible number of Routing Paths Assume that the streets are on a grid and the walking distance must be the shortest. Find the number of ways to walk from (0,0)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

CSE20 Lecture 15 - CSE 20 Lecture 15 Analysis:...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online