Counting Presentation
Counting Presentation
https://www.youtube.com/watch?v=2AoxCkySv34
Counting
How Do I Love Thee? (Sonnet 43)
Elizabeth Barrett Browning, 1806 – 1861
The order
does
matter!!!!
Product Rule
#. (A B) = #.A * #.B
Sum Rule
• Suppose a procedure P can be done in two
ways: A or B. If there are n ways to do A and
m ways to do B then there are n+m ways to do
P.
A and B must
be distinct!!
Sum Rule
A and B are
not distinct
Inclusion Exclusion Principle
(Subtraction)
26*26*10*10*10*10
Examples
There are more cars, so now we have new
license plates: 3 letters and 3 numbers, we still
have the old license plates
26*26*26*10*10*10
+ 26*26*10*10*10*10
Example
How many ways can you choose 3 different
digits without taking into account the order.
This means 3,4,5 would be the same as 3,5,4
and 4,3,5 and 4,5,3 and 5,3,4 and 5,4,3.
(N+N-1)! / ( (N-1)!(M!))
N! / ( (N-M)!(M!))
Example : Bank PINS
How many sequences, s, of {0 ..9} such that:
• #.s = 4
Permutation
with
1 2 3 4 repetition:
104
10 10 10 10
10,000
Example : Bank PINS
How many sequences, s, of {0 ..9} such that:
• #.s = 4
• All elements of s are different
Permutation
with
1 2 3 4 repetition:
10! / 6!
10!/(10-4)!
10*9*8*7*6*5*4*3*2 10 9 8 7
6*5*4*3*2
5040
Example : Bank PINS
How many sequences, s, of {0 ..9} such that:
• #.s = 4
• All elements of s are different
• Does not start with a 0
1 2 3 4
9 9 8 7
4536
Example : Bank PINS
How many sequences, s, of {0 ..9} such that:
• #.s = 4
• All elements of s are different
• Does not start with a 0
Sequences: with no repeats Sequences: with no repeats that begin with 0
1 2 3 4 1 2 3 4
10 9 8 7 1 9 8 7
5040 504
4536
Example
How many sequences, s, of {0 ..9} such that:
• #.s = 5
1 2 3 4 5
10 10 10 10 10
100,000
Example
How many sequences, s, of {0 ..9} such that:
• #.s = 5
• Pal(s)
Sequences of digits of length. 5 that are palindromes
1 2 3 4 5
10 10 10 1 1
1000
Example
How many sequences, s, of {0 ..9} such that:
• #.s = 5
• not Pal(s)
Sequences of digits of length. 5 that are palindromes
1 2 3 4 5 1 2 3 4 5
10 10 10 10 10 10 10 10 1 1
1000
100,000
99000
Example – another way
How many sequences, s, of {0 ..9} such that:
• #.s = 5
• not Pal(s)
Sequences of digits of length. 5 that are palindromes
1 2 3 4 5
10 10 10 9 9
BUT: We are counting
the in ones in which
both 4 is not 2 and
81,000 5 is not 1
Example – another way
How many sequences, s, of {0 ..9} such that:
• #.s = 5
• not Pal(s)
Sequences of digits of length. 5 that are palindromes
1 2 3 4 5 1 2 3 4 5
10 10 10 9 10 10 10 10 10 9
90,000 90000
1 2 3 4 5 1 2 3 4 5
10 10 10 9 10 10 10 10 10 9
90,000 1 2 3 4 5
90,000
10 10 10 9 9
99000 81,000
Examples : Committees
• 10 men
• 8 women
https://en.wikipedia.org/wiki/Poker_probability
Pigeonhole Principle
If you have a pigeon house with n holes and you
have m pigeons with m > n then at least one
hole must have more than one pigeon.
Pigeonhole principle
If k is a positive integer and k+1 objects are
placed into k boxes, then there is at least one
box containing two or more objects.
Pigeonhole principle
Let f: A B. Where #.A > #.B then A is not
one-to-one.
http://mindyourdecisions.com/blog/2008/11/2
5/16-fun-applications-of-the-pigeonhole-
principle/#.VkD8arcve1s