Professional Documents
Culture Documents
Counting
4 · 5 = 20 outfits
Product Rule Examples
_ _ _ _ _ _ _
2 · 2 · 2 · 2 · 2 · 2 · 2 = 27
26 · 26 · 26 · 10 · 10 · 10
17,576,000
Inclusion-Exclusion Principle
To count the number of distinct elements in two sets
– where it it possible for some elements to be in both sets
Of all CS students
– 25 take C++ programming
– 18 take discrete structures
– 6 take both
How many CS students are there?
– 25 + 18 is too many
25 + 18 - 6 = 37 CS students
Inclusion-Exclusion
C++ Discrete
19 6 12
25 18
Pigeonhole Principle
Pigeonhole Principle
If n objects
are placed in k boxes
there is at least one box containing at least
n/k objects
Generalized Pigeonhole Examples
P(n,r) = n(n-1)(n-2) … (n - r + 1)
= n!
Note: (n r ) !
P(n,n) = n! P(n,1) = n
Permutation Examples
P(n,n) = P(11,11) = n!
= 11!
= 11 10 7 2
Permutation Examples
C(n,r) =
Note:
C(n,n) = C(n,0) = 1
C(n,1) = C(n, n-1) = n
Combination Examples
{2,3,4}
{1,3,4}
{1,2,4}
{1,2,3}
Combination Examples
{1,2}
{1,3}
{1,4}
{2,3}
{2,4}
{3,4}
Combination Examples