Counting Problems: James Tanton
Counting Problems: James Tanton
Counting Problems: James Tanton
JAMES TANTON
www.jamestanton.com
This material comes from chapter 16 of: THINKING MATHEMATICS!
Vol2: Advanced Counting and Advanced Algebra Systems
CONTENTS:
STEP 1: THE MULTIPLICATION PRINCIPLE
12
16
Exercises
19
22
Solutions
25
14
How many different routes can one take to travel from Adelaide to Canberra?
Thinking Exercise 1: Is the answer 7 (from 3 + 4 ) or is the answer 12 (from
3 4 )? Be very clear in your own mind as to whether one should add or should
multiply these numbers.
Suppose there are also six major highways from Canberra to Darwin.
4
We have a general principle:
EXAMPLE: On a multiple choice quiz there are five questions, each with three
choices for an answer:
I decide to fill out my answers randomly. In how many different ways could I fill
out the quiz?
Answer: This is a five-stage process:
Task 1: Answer question one: 3 ways
Task 2: Answer question two: 3 ways
Task 3: Answer question three: 3 ways
Task 4: Answer question four: 3 ways
Task 5: Answer question five: 3 ways
By the multiplication principle there are 3 3 3 3 3 = 35 ways to complete the
quiz.
MJI
MIJ
IJM
IMJ
6
When playing with these problems it is clear that the following definition is needed:
Definition: The product of integers from 1 to N is called N factorial and is
denoted N ! .
These factorial numbers grow very large very quickly:
1! = 1
2! = 2 1 = 2
3! = 3 2 1 = 6
4! = 4 3 2 1 = 24
5! = 5 4 3 2 1 = 120
6! = 6 5 4 3 2 1 = 720
7! = 7 6 5 4 3 2 1 = 5040
8! = 8 7 6 5 4 3 2 1 = 40320
7
So far all is fine and dandy. We are lucky that my name isnt BOB. How might we
handle repeated letters?
How many ways are there to arrange the letters BOB? Assume the Bs are
indistinguishable?
Exercise 9: Answer this question! Do you think the only way to answer it is to list
all the possibilities? (It is probably the easiest way.)
But notice, if the Ss are no longer distinguishable, then pairs in this list of answers
collapse to give the same arrangement. We must alter our answer by a factor of
two and so the number of arrangements of the word HOUSES is:
6!
= 360
2
8
How many ways are there to rearrange the letters of the word CHEESE?
Answer: If the three Es are distinct written E1 , E2 , and E3 , say then there are
6! ways to rearrange the letters CHE1E2S E3. But the three Es can be rearranged
3! = 6 different ways within any one particular arrangement of letters. These six
arrangements would be seen as the same if the Es were no longer distinct:
HE1 E2 SCE3
HE1 E3 SCE2
HE2 E1 SCE3
HE3 E1 SCE2
HE3 E2 SCE1
HE2 E3 SCE1
HEESCE
Thus we must divide our answer of 6! by 3! to account for the groupings of six
that become identical. There are thus
6! 6 5 4 3 2 1
=
= 6 5 4 = 120 ways to
3!
3 2 1
6!
. The 2
2!
Explain why the number of ways to arrange the letters of the word CHEESES is
7!
.
3!2!
Answer: If the Es were distinguishable and the Ss were distinguishable, then wed
be counting the ways to arrange seven distinct letters:
There are 7! ways to arrange the letters of CHE1 E2 S1 E3 S 2
As before there are 3! ways to arrange the Es in any particular configuration.
These groups 3! will collapse to the same arrangement if we remove the
subscripts from the Es.
HE1 E2 S1CE3 S 2
HE1 E3 S1CE2 S 2
HE3 E1 S1CE2 S 2
HE3 E2 S1CE1 S 2
HE2 E1 S1CE3 S 2
HE2 E3 S1CE1 S 2
HEES1CE S2
HE1 E2 S 2 CE3 S1
HE1 E3 S 2 CE2 S1
HE2 E1 S 2 CE3 S1
HE3 E1 S 2 CE2 S1
HE3 E2 S 2 CE1 S1
HE2 E3 S 2 CE1 S1
HEES2 CE S1
Etc.
But these new arrangements also collapse in pairs once we remove the subscripts
from the Ss.
HE1 E2 S1CE3 S 2
HE1 E3 S1CE2 S 2
HE2 E1 S1CE3 S 2
HE3 E1 S1CE2 S 2
HE3 E2 S1CE1 S 2
HE2 E3 S1CE1 S 2
HEES1CE S 2
HEESCES
HE1 E2 S 2 CE3 S1
HE1 E3 S 2 CE2 S1
HE2 E1 S 2 CE3 S1
HE3 E1 S 2 CE2 S1
HE3 E2 S 2 CE1 S1
HE2 E3 S 2 CE1 S1
HEES2 CE S1
7!
2!
3!
BE SURE TO UNDERSTAND WHY THIS EQUALS
7!
3!2!
14!
.
6!3!2!
10
Consider the word CHEESIESTESSNESS, the quality of being the cheesiest of
cheeses. Do you see that there are
16!
5!6!
ways to arrange its letters?
Exercise 12: Actually evaluate this number.
This may seem strange, but it is actually better to write this answer as:
16!
1!1!5!6!1!1!1!
11
EXTRA:
Exercise 14: Evaluate the following expressions:
a)
800!
799!
b)
15!
87!
c)
13!2!
89!
N!
N!
e)
N!
( N 1)!
f)
n!
(n 2)!
g)
1 (k + 2)!
k +1
k!
h)
n !(n 2)!
( (n 1)!)
12
Answer:
7!
3!4!
13!
3!4!6!
13
We see that this is just a word arrangement problem. The answer is:
10! 10 9 8 7
=
= 10 3 7 = 210
4!6! 4 3 2 1
In general, we have
N!
a !b ! z !
14
Fifteen horses run a race. How many possibilities are there for first, second,
and third place?
Answer: One horse will be labeled first, one will be labeled second, one
third, and twelve will be labeled losers. The answer must be:
15!
= 15 14 13 = 2730 .
1! 1!1!12!
A feel good running race has 20 participants. Three will be deemed equal
first place winners, five will be deemed equal second place winners, and
the rest will be deemed equal third place winners. How many different
outcomes can occur?
Answer: Easy!
20!
.
3! 5!12!
15
20!
. Piece of cake!
1!1!5!3!2!1!2!5!
Suppose 5 people are to be chosen from 12 and the order in which folk are
chosen is not important. How many ways can this be done?
Answer: 5 people will be labeled chosen and 7 not chosen. There are
ways to accomplish this task.
12!
5!7!
Suppose 5 people are to be chosen from 12 for a team and the order in
which they are chosen is considered important. In how many ways can this be
done?
Answer: We have:
1 person labeled first
1 person labeled second
1 person labeled third
1 person labeled fourth
1 person labeled fifth
7 people labeled not chosen
This can be done
12!
ways.
1!1!1!1!1!7!
16
STEP 4: MULTI-STAGELABELING
There are 7 men and 6 women in an office. How many ways are there to make
a committee of five if
a) Gender is irrelevant?
b) The committee must be all male?
c) The committee must consist of 2 men and 3 women?
17
Nationality is irrelevant?
The team must be all American?
The team must have 5 Americans, 5 Australians, and 4 Austrians?
Nationality is irrelevant, but Dr. T. must be on the team?
Answer:
40!
(Do you see why?)
a)
14!26!
b)
20!
(Do you see why?)
14!6!
20!
5!15!
10!
5!5!
10!
Deal with the Austrians:
4!6!
ways to
5!15! 5!5! 4!6!
make a team.
d) With Dr. T. on the problem is now to select 13 more team members
39!
ways to do this.
from 39 people. There are
13!26!
18
Example: In how many ways can one arrange the letters AMERICA
a)
b)
c)
d)
if
if
if
if
Answer: a)
7!
(Why?)
2!
There are
6!
ways.
2!
There are
5!
ways.
2!
19
EXERCISES:
Question 1: How many different paths are there from A to G?
Question 2:
a) In how many different ways can one arrange five As and five Bs.
b) A coin is tossed 10 times. In how many different ways could exactly
five heads appear?
Question 3: The word BOOKKEEPING is the only word in the English
language (ignoring its variants bookkeeper, etc.) with three consecutive
double letters. In how many ways can one arrange the letters of this word?
Question 4: A multiple choice quiz has 10 questions each with 4 different
possible answers. In how many ways can one fill out the quiz?
Question 5: In how many ways can one write down three vowels in order
from left to right? How does the answer change if we insist that the vowels
all be different?
Question 6: Ten people are up for election. In how many ways can one fill
out a ballot for president and for vice president?
20
Question 7:
a) A mathematics department has 10 members. Four members are to be
selected for a committee. In how many different ways can this be
done?
b) A physics department has 10 members and a committee of four is
needed. In that committee, one person is to be selected as chair. In
how many different ways can one form a committee of four with one
chair?
c) An arts department has 10 members and a committee of four is
needed. This committee requires two co-chairs. In how many different
ways can one form a committee of four with two co-chairs?
d) An English department has 10 members and two committees are
needed: One with four members with two co-chairs and one with three
members and a single chair. In how many different ways can this be
done?
Question 8: Three people from 10 will be asked to sit on a bench: one on the
left end, one in the middle, and one on the right end. In how many different
ways can this be done?
Question 9: Five pink marbles, two red marbles, and three rose marbles are
to be arranged in a row. If marbles of the same colour are identical, in how
many different ways can these marbles be arranged?
Question 10:
a) Hats are to be distributed to 20 people at a party. Five hats are red,
five hats are blue, and 10 hats are purple. In how many different ways
can this be done? (Assume the people are mingling and moving about.)
b) CHALLENGE: If the 20 people are clones and cannot be
distinguished, in how many essentially different ways can these hats
be distributed?
Question 11: In how many ways can one arrange the letters of
NOODLEDOODLE if the arrangement must begin with an L and end with an
E?
21
Question 12: A committee of five must be formed from five men and seven
women.
a) How many committees can be formed if gender is irrelevant?
b) How many committees can be formed if there must be at exactly two
women on the committee?
c) How many committees can be formed if one particular man must be on
the committee and one particular woman must not be on the
committee?
d) CHALLENGE: How many committees can be formed if one particular
couple (one man and one woman) cant be on the committee together?
Question 13:
a) Twelve white dots lie in a row. Two are to be coloured red. In how
many ways can this be done?
b) Consider the equation 10 = x + y + z . How many solutions does it have if
each variable is to be a positive integer or zero?
Question 14:
a) In how many ways can the letters ABCDEFGH be arranged?
a) In how many ways can the letters ABCDEFGH be arranged with letter G
appearing somewhere to the left of letter D?
b) In how many ways can the letters ABCDEFGH be arranged with the
letters F and H adjacent?
22
52!
= 2598960 five-card hands in total in poker.
5!47!
5148
(Why?) The chances of being dealt a flush are thus:
0.20% .
2598960
23
24
This process made the multi-stage procedure clear to all and the count of
possible one pair hands, namely,
13!
4!
4 4 4
1!3!9! 2!2!
readily apparent.
EXERCISE: Two pair consists of two cards of one value, two cards of a
different value, and a third card of a third value. What are the chances of
being dealt two-pair in poker?
25
SOLUTIONS
PAGE 3 SOLUTIONS:
1. For each route one chooses to travel from A to B, there are four options
as to which route to take from B to C.
Top route A to B with four options B to C
PLUS
Middle route A to B with four options B to C
PLUS
Bottom route A to B and with four options B to C.
We have three groups of four, 4 + 4 + 4 , which corresponds to multiplication:
3 4 .
2. For each of the twelve routes from A to B there are six options from C
to D. We have 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 = 12 6 .
3. 5 4 2 = 40
4. 10 10 = 100
PAGE 4 SOLUTIONS:
5. The caveat in the statement is important. For example, in the clothing
example, if I would never wear my mushroom-pink trousers with my lilac
shirt, then the computation 5 4 2 would not apply. In the movie example, if
I only ever eat popcorn during a romance movie, then the computation 10 10
does not apply.
PAGE 5 SOLUTIONS:
6. 5 4 3 2 1 = 120
7. 6 5 4 3 2 1 = 720
26
PAGE 6 SOLUTIONS:
8. 11!
PAGE 7 SOLUTIONS:
9. Three ways: BOB, BBO, OBB
10. No! Listing them doesnt seem fun!
PAGE 9 SOLUTIONS:
11. If the letters were distinguishable, there would be 14! ways to arrange
them. However, this answer collapses by a factor of 6! if we remove
distinguishing subscripts from the Es (there are 6! ways to arrange the Es
amongst themselves in any particular pattern of letters). So we need to
divide this answer by 6! . But these answers will collapse by a factor of 3!
if we remove subscripts from the Ss and again by a factor of 2! if we do the
same for the Ts. So our initial answer 14! is divided be each of 6! , 3! and 2! .
PAGE 10 SOLUTIONS:
12.
16! 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
=
5!6!
5 4 3 2 1 6 5 4 3 2 1
16 15 14 13 12 11 10 9 8 7
5 4 3 2 1
= 16 15 14 13 11 9 8 7
=
= 190270080
13. Maybe. Multiply together all the numbers from 1 up to 1. I guess this
means 1! = 1 (and there isnt much multiplication to do!)
PAGE 11 SOLUTIONS:
14. a) 800 b) 105
15. d) 1
e) N
c)
1
88 89
f) n ( n 1)
g) k + 2
h)
n
n 1
27
Question 2: a)
Question 3:
11!
2!2!2!
10!
= 10 9 = 90
1!1!8!
10!
4!6!
b)
10!
1!3!6!
c)
10!
2!2!6!
d)
10!
2!2!1!2!3!
Question 8: Think: Sit left, sit middle, sit right, dont sit.
Question 9:
10!
1!1!1!7!
10!
5!2!3!
20!
5!5!10!
b) ONE! If folk are identical then all distributions of hats look the same!
Question 10: a)
Question 11:
10!
1!4!3!1!1!
28
12!
= 792
5!7!
5!
7!
= 210
3!2! 2!5!
c) We need to select four more people for the committee from a group
10!
= 210 .
of ten:
4!6!
10!
d) There are
committees with them on together. (We need three
3!7!
people from ten for the remainder of the committee.) As there are
12!
12! 10!
committees in total, there are
12!
= 66 ways.
2!10!
b) Do you see this is the same problem? Each picture of 12 dots with two
coloured red gives three values for x, y and z : count the number of white
Question 13: a)
dots to the left of the first red dot, the number of white dots between the
two red dots, and the number of white dots to the right of the second red
dot. And conversely, any solution to 10 = x + y + z corresponds to a picture of
dots. The answer is also 66.
Question 14:
a) 8! = 40320
b) Of the 8! arrangements in total half will have G to the left of D and half
will have D to the left of G. There are thus 8!/ 2 = 20160 arrangements of
the type we seek.
c) Imagine the letters F and H stuck together as a single block, either as
FH or as HF. There are 7! ways to arrange A, B, C, D, E, G, and FH; and
there are 7! ways to arrange A, B, C, D, E, G, and HF. Thus there are
2 7! = 10080 arrangements with F and H adjacent.