Professional Documents
Culture Documents
1
Reference Book
2
Grade Distribution
ASSESSMENT TASKS MARKS PROPORTION
Midterm exam 20%
quizzes 30%
(best 3 from 4 quizzes)
Attendance 5%
(Lectures + Tutorials)
Assignments (Tutorial) 5%
Final exam 40%
Total 100%
3
COUNTING TECHNIQUES
(ways to combine things)
PERMUTATIONS
AND
COMBINATIONS 4
you have the following choices in your dinner :
ENTREES MAINS
DESSERTS
How many different combinations
of meals could you make?
We'll build a tree diagram to
icecream 5
show all of the choices.
Notice the number of choices at each branch We ended up with
12 possibilities
2 3 2
choices choices choices soup, chicken, ice cream
2 3 2 = 12 soup, chicken,
6 4 5 3 = 360
7
Example
• How many different ways can we choose
from 4 colors to paint 3 rooms?
– Tasks:
• 1 - paint room 1 - 4 ways to perform (4 colors)
• 2 - paint room 2 - 4 ways to perform (4 colors)
• 3 - paint room 3 - 4 ways to perform (4 colors)
4 4 4 = 64
ways to paint the rooms
8
Example
• How many different ways can we choose from
4 colors to paint 3 rooms, under condition the
color of the rooms are different?
– tasks:
• 1 - paint room 1 - 4 ways to perform (4 colors)
• 2 - paint room 2 - 3 ways to perform (3 colors left)
• 3 - paint room 3 - 2 ways to perform (2 colors left)
54321 = 5!=120
10
Example
• How many license plates are possible with 3
Arabic letters followed by 3 digits?
• 282828101010 = 21952000
11
Example
• How many different 6-place license plates are
possible if the first 3 places are for Arabic letters
and the other 3 places for numbers under
assumption that no letters or numbers can be
repeated in a single license plate?
• 2827261098 =14152320
12
Counting Methods
Counting methods
Combinations—
Permutations— Order doesn’t
order matters! matter
Without replacement
13
A permutation is an ordered arrangement
of r objects chosen from n objects.
types of permutations.
The first is distinct with repetition.
this means different
This means there are n
distinct objects but in
choosing r of them you
can repeat an object.
Let's look at a 3 There are 10 choices for the first number
combination lock There are 10 choices for the second number
with numbers 0 and you can repeat the first number
through 9
There are 10 choices for the third number
and you can repeat
15
Example
• Select two out of three colored balls with
repetition :
32 = 9 choices 16
Example
Consider the set S = {a, b, c}.
• How many words of 2 letters of S?
aa ab ac bb ba bc ca cb cc
32 = 9 choices
• How many words of 3 letters of S?
33 = 27 choices
17
Example
Consider the set S = {a, b, c, d}.
• How many words of 2 letters of S?
42 = 16 choices
18
The second type of permutation is distinct, without
repetition.
Let's say four people have a race. Let's look at the
possibilities of the first and second places only. ( Once a
person has been listed in a place, you can't use that person
again) (no repetition).
First place would be Based on the multiplication principle:
choosing someone from 4 3 = 12 choices
among 4 people.
Now there are only 3 to
choose from for second
place.
2nd 1st
19
nP , means the number of ordered arrangements of r objects
r
chosen from n distinct objects and repetition is not allowed.
n!
n
Pr
n r !
4! 4 3 2 1
In the last example: 4 P 12
2
4 2! 2!
If you have 10 people
racing and only 1st, 2nd
and 3rd place how many
possible outcomes are
there?
10! 10 9 8 7!
10
P3 72020
10 3! 7!
Example
Consider the set S = {a, b, c}.
• How many words of 2 different letters of S?
ab ac ba bc ca cb
3! 3!
3
P2 6
3 2 ! 1!
21
Example
Consider the set S = {a, b, c, d}.
• How many words of 2 different letters of S?
ab ac ad ba bc bd
ca cb cd da db dc
4! 4!
4
P2 12
4 2 ! 2! 22
Example
• How many different 2 people can be
selected from a group of 8 people to a
president and vice-president?
8!
8
P2 8 7 56
8 2 !
23
A combination is an arrangement of r
objects chosen from n objects regardless
of order.
nC , means the number combinations of r objects chosen
r
from n distinct objects and repetition is not allowed.
n! n
n
Cr or
n r !r! r
Order doesn't matter here so the combination 1, 2, 3 is not
different than 3, 2, 1 because they both contain the same
numbers.
24
You need 2 people on your committee and you have 5 to
choose from. You can see that this is without repetition
because you can only choose a person once, and order
doesn’t matter. You need 2 committee members but it
doesn't matter who is chosen first. How many
combinations are there?
5! 5 4 3!
C2
5
10
5 2! 2! 3! 2
25
Combinations
Consider the set B = {a, b, c, d}.
• What are the subsets of two elements of B?
{a, b} {a, c} {a,d} {b, c} {b, d} {c, d}
4! 4!
4
C2 6
4 2 ! 2! 2! 2!
• What are the subsets of three elements of B?
{a, b, c} {a, c, d} {b, c, d} {a, b, d}
4! 4!
4
C3 4
4 3! 3! 1! 3!26
Combinations
• How many subsets of size 5 are there of the
set {1, 2, 3, ..., 10}?
10! 10!
C5
10
252
10 5! 5! 5! 5!
• How many subsets of size 3?
• How many subsets of size 2?
• How many subsets of size 8?
27
Combinations
• A certain club has 5 male and 7 female
members.
– How many ways are there to form a 5 member
committee consisting of 3 men and 2 women?
• Two tasks - pick a man, then pick a woman.
• Thus:
5! 7!
C3 C2
5 7
210
2! 3! 5! 2!
28
Combinations
• A certain club has 5 men and 6 women.
– How many ways are there to form a committee
of 3 people?
11
C3
29
Summary of Counting Methods
Counting methods
Combinations—
Permutations— Order doesn’t
order matters! matter
With replacement: nr
Without
replacement:
Without replacement: n!
n
Cr
n! n r !r !
n
Pr
n r ! 30
Acknowledgement
I wish to thank Shawna Haider from Salt Lake Community College, Utah
USA for her hard work in creating this PowerPoint.
31
Computer Science, Statistics and
Probability all involve counting techniques
which are a branch of mathematics called
combinatorics (ways to combine things).
We'll be introducing this topic in this
lecture.
32
Dress Mr. Arnold
3 Shirts 2 Pants
2 Pairs of Shoes
33
Dress Mr. Arnold
1
2
34
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
35
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
4
5
6
36
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
4
5
6
7
37
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
4
5
6
7
8
9
10
38
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
4
5
6
7
8
9
10
11
39
Dress Mr. Arnold
• List all of Mr. Arnold’s outfits 1
2
3
4
5
6
7
8
9
10
11
40