Mixed Counting Problems
We have studied a number of counting principles and
techniques since the beginning of the course and when we tackle
a counting problem, we may have to use one or a combination
of these principles. The counting principles we have studied are:
I
Inclusion-exclusion principle: n(A B) = n(A) + n(B) n(A B).
I
Complement Rule n(A
0
) = n(U ) n(A).
I
Multiplication principle: If I can break a task into r steps, with m
1
ways of
performing step 1, m
2
ways of performing step 2 (no matter what I do in step
1), . . . , m
r
ways of performing step r (no matter what I do in the previous
steps), then the number of ways I can complete the task is
m
1
· m
2
· · · m
r
.
(This also applies if step i of task amounts to selecting from set A
i
with m
i
elements.)
I
Addition principle: If I must choose exactly one activity to complete a task
from among the (disjoint) activities A
1
, A
2
, . . . , A
r
and I can perform activity 1
in m
1
ways, activity 2 in m
2
ways, . . . , activity r in m
r
ways, then I can
complete the task in
m
1
+ m
2
+ · · · + m
r
ways. (This also applies if task amounts to selecting one item from r disjoint
sets A
1
, A
2
, . . . , A
r
with m
1
, m
2
, . . . , m
r
items respectively.)
I
Permutations: The number of arrangements of n objects taken r at a time is
P(n, r) = n · (n 1) · · · (n r + 1) =
n!
(n r)!
.
I
Permutations of objects with some alike:
I
The number of different permutations (arrangements), where
order matters, of a set of n objects (taken n at a time) where r of
the objects are identical is
n!
r!
.
I
Consider a set of n objects which is equal to the disjoint union of
k subsets, A
1
, A
2
, . . . , A
k
, of objects in which the objects in each
subset A
i
are identical and the objects in different subsets A
i
and
A
j
, i 6= j are not identical. Let r
i
denotes the number of objects
in set A
i
, then the number of different permutations of the n
objects (taken n at a time) is
n!
r
1
!r
2
! . . . r
n
!
.
This can also be considered as an application of the technique of
“overcounting” where we count a larger set and then divide.
I
Combinations: The number of ways of choosing a subset of (or
a sample of) r objects from a set with n objects, where order
does not matter, is
C(n, r) =
P (n, r)
r!
=
n!
r!(n r)!
.
Note this was also an application of the technique of
“overcounting”.
Mixed Counting Problems
Problem Solving Strategy: You may be able to solve a
counting problem with a single principle or a problem may
be a multilevel problem requiring repeated application of
one or several principles. When asked to count the number
of objects in a set, it often helps to think of how you might
complete the task of constructing an object in the set. It
also helps to keep the technique of “overcounting” in mind.
The following flowchart from your book may help you
decide whether to use the multiplication principle, the
addition rule, the formula for the number of permutations
or the formula for the number of combinations for a
problem or a problem part requiring one of these.
Mixed Counting Problems
Mixed Counting Problems
Example An experiment consists of rolling a 20 sided die
three times. The number on top of each die is recorded.
The numbers are written down in the order in which they
are observed. How many possible ordered triples of
numbers can result from the experiment? (Note the triple
(17, 10, 3) is not the same result as the triple (3, 10, 17). )
There are 20 ways each throw can come up and the order is
important so the answer is 20 · 20 · 20 = 20
3
= 8000.
Mixed Counting Problems
Example (Hoosier Lottery) When you buy a Powerball
ticket, you select 5 different white numbers from among the
numbers 1 through 59 (order of selection does not matter),
and one red number from among the numbers 1 through
35. How many different Powerball tickets can you buy?
If you check out the Powerball web site you will see that
you need to select 5 distinct white numbers, so you can do
this C(59, 5) = 5, 006, 386 ways. Then you can pick the red
number C(35, 1) = 35 ways so the total number of tickets is
C(59, 5) · P(35, 1) = 5, 006, 386 · 35 = 175, 223, 510.
Mixed Counting Problems
Often problems fit the model of pulling marbles from a bag.
For example many of our previous problems involving poker
hands fit this model. Polling a population to conduct an
observational study also fit this model.
Example: An bag contains 15 marbles of which 10 are
red and 5 are white. 4 marbles are selected from the bag.
There’s ambiguity here: e.g., if on one draw I select four
red marbles, and on another draw I select a different four
red marbles, are these considered the same sample or not?
We’ll assume that they are not the same sample. For
example, we could imagine that the marbles are numbered,
each with a different number, so that we can tell marbles of
the same color apart. This way of thinking will be very
useful for calculating probabilities later, when we try to set
up an “equally likely sample space”
Mixed Counting Problems
10 red, 5 white, numbered marbles
(a) How many (different) samples (of size 4) are possible?
The order does not matter but the numbers do so we are
selecting 4 elements from a set of 10 + 5 elements. Hence
the answer is C(15, 4) = 1, 365.
(b) How many samples (of size 4) consist entirely of red
marbles?
The order does not matter but the numbers do so we are
selecting 4 elements from a set of 10 elements. Hence the
answer is C(10, 4) = 210.
Mixed Counting Problems
10 red, 5 white, numbered marbles
(c) How many samples have 2 red and 2 white marbles?
We can select 2 numbered red marbles in C(10, 2) ways and
2 numbered white marbles in C(5, 2) ways. Neither choice
affects the other so the answer is
C(10, 2) · C(5, 2) = 45 · 10 = 450.
(d) How many samples (of size 4) have exactly 3 red
marbles? We can select 3 numbered red marbles in C(10, 3)
ways and 1 numbered white marble in C(5, 1) ways.
Neither choice affects the other so the answer is
C(10, 3) · C(5, 1) = 120 · 5 = 600.
Mixed Counting Problems
10 red, 5 white, numbered marbles
(e) How many samples (of size 4) have at least 3 red?
The answer is the number of samples with 3 red plus the
number of samples with 4 red. We can select 4 numbered
red marbles in C(10, 4) ways and 0 numbered white
marbles in C(5, 0) ways. Neither choice affects the other so
the answer is C(10, 4) · C(5, 0) = 210 · 1 = 210.
From the last example, there are 600 ways to select samples
with exactly 3 red marbles so our answer is
600 + 210 = 810.
Mixed Counting Problems
10 red, 5 white, numbered marbles
(f) How many samples (of size 4) contain at least one red
marble?
One answer is“the number with exactly 1” + “the number
with exactly 2” . . . “the number with exactly 4”. This is
C(10, 1)·C(5, 3)+C(10, 2)·C(5, 2)+C(10, 3)·C(5, 1)+C(10, 4)·C(5, 0)
which is
10·10+45·10+120·5+210·1 = 100+450+600+210 = 1, 360
It is also the total number of samples (1, 365) minus the
number of samples with no red marbles which is
C(10, 0) · C(5, 4) = 5.
Mixed Counting Problems
Example: Recall that a standard deck of cards has 52
cards. The cards can be classified according to suits or
denominations. There are 4 suits, hearts, diamonds, spades
and clubs. There are 13 cards in each suit. There are 13
denominations, Aces, Kings, Queens, .......... ,Twos, with 4
cards in each denomination. A poker hand consists of a
sample of size 5 drawn from the deck. Poker problems are
often like urn problems, with a hitch or two.
(a) How many poker hands consist of 2 Aces and 3 Kings?
You can pick aces in C(4, 2) ways and kings in C(4, 3)
ways. Neither choice affects the other so the answer is
C(4, 2) · C(4, 3) = 6 · 4 = 24.
Mixed Counting Problems
(b) How many poker hands consist of 2 Aces, 2 Kings and a
card of a different denomination?
You can pick the 2 aces, 2 kings in
C(4, 2) · C(4, 2) = 6 · 6 = 36 ways. You can pick the
remaining card in any of 52 8 = 44 ways so the answer is
36 · 44 = 1, 584.
(c) How many Poker hands have three cards from one
denomination and two from another (a full house)?
There are 13 ways to pick the first denomination. Then are
then C(4, 3)ways to pick 3 cards of that denomination.
There are 12 ways to pick the second denomination and
then C(4, 2) ways to pick 2 cards of that denomination.
Hence there are
13 · C(4, 3) · 12 · C(4, 2) = 13 · 4 · 12 · 6 = 3, 744.
Note if you decide to pick 2 cards of the first denomination
you choose the answer is
13 · C(4, 2) · 12 · C(4, 3) = 13 · 6 · 12 · 4 = 3, 744.
Mixed Counting Problems
(d) A royal flush is a hand consisting of an Ace, King,
Queen, Jack and Ten, where all cards are from the same
suit. How many royal flushes are possible?
There is exactly 1 way to pick a royal flush in each suit so
there are 4 of them.
(e) A flush is a hand consisting of five cards from the same
suit. How many different flushes are possible?
There are C(13, 5) ways to get all cards of the same suit so
there are C(13, 5) · C(4, 1) = 1, 287 · 4 = 5, 148 flushes.
Mixed Counting Problems
Another useful model to keep in mind is that of repeatedly
flipping a coin. This is especially useful for counting the
number of outcomes of a given type when the experiment
involves several repetitions of an experiment with two
outcomes. We will explore probabilities for experiments of
this type later when we study the Binomial distribution.
We have already used this model in taxi cab geometry.
Example: Coin Flipping Model If I flip a coin 20 times,
I get a sequence of Heads (H) and tails (T).
(a) How many different sequences of heads and tails are
possible?
There are 2 ways the first flip can come up; 2 more for the
second and so on. Hence 2 · · · 2 = 2
20
= 1, 048, 576.
Mixed Counting Problems
(b) How may different sequences of heads and tails have
exactly five heads?
Now we want to keep track of how many heads/tails there
are in our sequence. This problem is similar to the taxi cab
problem. There are 20 positions which need to be filled
with either an 'H' or a 'T'. If we want exactly h heads in
the sequence the answer if C(20, h).
To see we are on the right track recall
2
n
= C(n, 0) + C(n, 1) + C(n, 2) + C(n, 3) + · · · + C(n, n)
so the number of sequences with 0 heads plus the number
of sequences with 1 head plus . . . plus the number of
sequences with 20 heads is all the sequences so should be
2
20
as in part (a). The actual answer to our problem is
C(20, 5) = 15, 504.
Mixed Counting Problems
(c) How many different sequences have at most 2 heads?
We did the work in part (b). The answer is
C(20, 0) + C(20, 1) + C(20, 2) = 1 + 20 + 190 = 211
(d) How many different sequences have at least three heads?
C(20, 3) + C(20, 4) + · · · + C(20, 19) + C(20, 20).
OR
2
20
C(20, 0)+C(20, 1)+C(20, 2)
= 1, 048, 576211 = 1, 048, 365
Mixed Counting Problems
Example To make a non-vegetarian fajita at Lopez’s Grill,
you must choose between a flour or corn tortilla. You must
then choose one type of meat from 4 types offered. You can
then add any combination of extras (including no extras).
The extras offered are fajita vegetables, beans, salsa,
guacamole, sour cream, cheese and lettuce. How many
different fajitas can you make?
Think of this from the point of view of the kitchen. An
order comes in and you need to assemble it. First you
select the tortilla: 2 choices. Then you add the meat: 4
choices. So far there are 2 · 4 = 8 possibilities. Now you
need to add the extras. There are 7 extras and the order
can be any subset of them. Hence your choices are any
subset of this set with 7 elements so 2
7
= 128. Hence the
total possible is 8 · 128 = 1024.
Extra Problems
Example (a) How many different words (including
nonsense words) can you make by rearranging the letters of
the word
EFFERVESCENCE
E7→ 5; F7→ 2; R7→ 1; V7→ 1; S7→ 1; C7→ 2; N7→ 1. Hence
there are 5 + 2 + 1 + 1 + 1 + 2 + 1 = 13 letters total and so
there are
13!
2! · 5! · 2! · 1! · 1! · 1! · 1!
=
P(13, 5)
4
=
51, 891, 840
4
= 12, 972, 960
words.
Extra Problems
(b) How many different 4 letter words (including nonsense
words) can be made from the letters of
EFFERVESCENCE, if letters cannot be repeated?
There are 7 distinct letters so if repetitions are not
permitted the answer is P(7, 4) = 840.
(c) How many different 4 letter words (including nonsense
words) can be made from the letters of the above word, if
letters can be repeated?
Answer: 7
4
. Do not confuse this with the MUCH harder
problem of given 13 tiles with the letters in
EFFERVESCENCE, how many 4 letter words can be
produced? So for example, you could use F twice but not 3
times.
Extra Problems
Example The Notre Dame Model UN club has 20
members. Five are seniors, four are juniors, two are
sophomores and nine are freshmen.
(a) In how many ways can the club select a president, a
secretary and a treasurer if every member is eligible for
each position and no member can hold two positions?
20 members, 3 officers so P(20, 3). Note you are selecting
an ordered subset of 3 distinct elements.
(b) In how many ways can the club choose a group of 5
members to attend the next Model UN meeting in
Washington.
Answer: C(20, 5). This time you need a subset of all the
members which has 5 elements but the order isn’t
important.
Extra Problems
(c) In how many ways can the club choose a group of 5
members to attend the next Model UN meeting in
Washington if all members of the group must be freshmen?
Answer: C(9, 5) since you now must select your subset
from the set of 9 freshmen.
Extra Problems
(d) In how many ways can the group of five be chosen if
there must be at least one member from each class?
There are 5 ways to select a senior, 4 ways to select a
junior, 2 ways to select a sophomore and 9 ways to select a
freshman. This gives 5 · 4 · 2 · 9 = 360 ways to select a
subset with 4 elements containing one member of each
class. When you have done this there are 20 4 = 16
members left and you may choose any one of these to round
out the group. Hence the answer is
360 · 16
2
= 2, 880. You
must divide by 2 because each set of 5 elements selected by
this procedure occurs twice.
Extra Problems
Here is another approach. Because there are 5 members in
the subset and 4 classes, exactly one class occurs twice. If
there are 2 seniors, these can be selected in C(5, 2) ways
and the set filled out with 1 junior, 1 sophomore and 1
freshman, hence in C(5, 2) · 4 · 2 · 9 = 720 ways. If there are
2 juniors, these can be selected in C(4, 2) ways and the set
filled out with 1 senior, 1 sophomore and 1 freshman, hence
in 5 · C(4, 2) · 2 · 9 = 540 ways. If 2 sophomores,
5 · 4 · C(2, 2) · 9 = 180. If 2 freshmen,
5 · 4 · 2 · C(9, 2) = 1, 440. Hence the answer is
720 + 540 + 180 + 1, 440 = 2, 880.
Extra Problems
Example Harry Potter’s closet contains 12 numbered
brooms, of which 8 are Comet Two Sixty’s (numbered 1 -
8) and 4 are Nimbus Two Thousand’s (Numbered 9-12).
Harry, Ron, George and Fred want to sneak out for a game
of Quidditch in the middle of the night. They don’t want
to turn on the light in case Snape catches them. They
reach in the closet and pull out a sample of 4 brooms.
Extra Problems
(a) How many different samples are possible?
This is not a well-defined question. Do you want to know
how many different sets of brooms you can get or do you
want to know how many ways there are if we keep track of
which broom Harry gets, which one Ron gets, and so on.
In other words, do you want subsets or ordered subsets?
For subsets, the answers is C(12, 4) = 495; for ordered
subsets the answer is P(12, 4) = 11, 880.
Extra Problems
(b) How many samples have only Comet Two Sixty’s in
them?
Replace the 12 in the answers for part (a) with 8.
(c) How many samples have exactly one Comet Two Sixty
in them?
The unordered version solution is familiar. There are
C(8, 1) = 8 ways to pick the Comet Two Sixty and
C(4, 3) = 4 ways to pick the rest so the answer is 8 · 4 = 32.
To do the ordered version, observe that once you have an
unordered set of 4 elements, there are 4! = 24 ways to order
it. Hence the ordered answer is 32 · 24 = 768.
Extra Problems
(d) How many samples have at least 3 Comet Two Sixty’s?
Figure out how many samples there are with exactly 3;
then figure out how many there are with exactly 4 and then
add the two answers.
For exactly k Comet Two Sixty’s we have
C(8, k) · C(4, 4 k) unordered subsets and therefore
C(8, k) · C(4, 4 k) · 4! ordered ones.