100% found this document useful (1 vote)
146 views

Counting Presentation

Counting is an important mathematical concept with many applications. There are different types of counting problems involving ordered or unordered elements. Basic principles of counting include counting each element only once and counting the total of all elements. The product rule and sum rule provide ways to calculate the number of possibilities when a problem can be broken into sequential or alternative tasks. The inclusion-exclusion principle handles situations where some possibilities are counted more than once. Examples demonstrate counting permutations, combinations, and arrangements in different scenarios.

Uploaded by

Silvia Takahashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
146 views

Counting Presentation

Counting is an important mathematical concept with many applications. There are different types of counting problems involving ordered or unordered elements. Basic principles of counting include counting each element only once and counting the total of all elements. The product rule and sum rule provide ways to calculate the number of possibilities when a problem can be broken into sequential or alternative tasks. The inclusion-exclusion principle handles situations where some possibilities are counted more than once. Examples demonstrate counting permutations, combinations, and arrangements in different scenarios.

Uploaded by

Silvia Takahashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Counting

https://www.youtube.com/watch?v=2AoxCkySv34
Counting
How Do I Love Thee? (Sonnet 43)
Elizabeth Barrett Browning, 1806 – 1861

How do I love thee? Let me count the ways.


I love thee to the depth and breadth and height
My soul can reach, when feeling out of sight
For the ends of being and ideal grace.
I love thee to the level of every day’s
Most quiet need, by sun and candle-light.
I love thee freely, as men strive for right.
I love thee purely, as they turn from praise.
I love thee with the passion put to use
In my old griefs, and with my childhood’s faith.
I love thee with a love I seemed to lose
With my lost saints. I love thee with the breath,
Smiles, tears, of all my life; and, if God choose,
I shall but love thee better after death.
Counting
• Enumerating
• Applications
– Complexity of algorithms
– Probability
– Simulations
• Types of problem
– Ordered
– Unordered
Counting is not always easy!!!
Basic Principles
• Count everything
• Don’t count anything more than once
Product Rule
• Suppose a procedure P can be broken down
into a sequence of 2 tasks: A followed by B. If
there are n ways to do A and m ways to do B
then there are n*m ways to do P.

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  B = )  (#. (A  B) = #.A + #.B)


Inclusion Exclusion Principle
(Subtraction)
• Suppose a procedure P can be done in two
ways: A or B. If there are n ways to do A, m
ways to do B and there are p ways that are
common to A and B, then there are n+m-p
ways to do P.

A and B are
not distinct
Inclusion Exclusion Principle
(Subtraction)

#. (A  B) = #.A + #.B - #.(A  B)


Examples
License plates in some country: 2 letters and 4
numbers.

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.

Choose the first number : 10


Choose the second number : 9
Choose the third number : 8
10*9*8
But here the order does matter…. We are counting the 6 possibilities
10*9*8/6
General Formulas

(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

BUT: We are counting


the in ones in which
180000
both 4 is not 2 and
5 is not 1, twice
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 1 2 3 4 5
90,000
10 10 10 9 9

99000 81,000
Examples : Committees
• 10 men
• 8 women

How many committees of 7?


18
7
Examples : Committees
• 10 men
• 8 women

How many committees of 7 in which there is at


least one woman:
Total number of committees – committees of only
men
20 10
-
7 7
Examples : People in a row
• 10 men
• 8 women

How many ways can you seat 5 people in a row


such that no men and no women are seated side by
side.
First one is a man. M F M F M : 10*8*9*7*8
First one is a woman: F M F M. F. 8*10*7*9*6
The result is 10*8*9*7*8 + 8*10*7*9*6
(10! / 7!)(8! / 6!) +. (8! / 5!)(10! / 8!)
Examples : People in a row
10 men and 8 women
How many ways can you seat 6 men and 3 women in a row so that
no two women are seated side by side?
• You have to choose and seat 6 men:
10! / 4!
• Say that they are seated: M1 M2 M3 M4 M5 M6
• How can you seat women?
– They can seat in the places beside the men:
S1 M1 S2 M2 S3 M3 S4 M4 S5 M5 S6 M6 S7
• So you have to choose the positions where the women will seat:
7
– 3 positions from the 7 positions:
3
8
– And you have to choose the 3 women
3
Poker Odds

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

You might also like