1. 1 mult rule

advertisement
page 1 of Section 1.1
CHAPTER 1 COUNTING
SECTION 1.1 THE MULTIPLICATION RULE
the multiplication rule
Suppose you have 3 shirts (blue, red, green) and 2 pairs of pants (checked, striped).
The problem is to count the total number of outfits.
The tree diagram (Fig 1) shows all possibilities: there are 2 ≈ 3 = 6 outfits.
PANTS
SHIRTS
checks
OUTFITS
blue
checked pants, blue shirt
red
checked pants, red shirt
green
checked pants, green shirt
blue
striped pants, blue shirt
red
striped pants, red shirt
green
striped pants, green shirt
stripes
FIG 1
Instead of drawing the tree which takes a lot of space, think of filling a pants
slot and a shirt slot (Fig 2). The pants slot can be filled in 2 ways, the shirt
slot in 3 ways and the total number of outfits is the product 2 ≈ 3.
l
o
s t
y
a
2 w
pants slot
FIG 2
(1)
fil
l
3
o
s t
way
fil
shirt slot
number of outfits = 3 ≈ 2
If an event takes place in successive stages (slots), decide in how many
ways each slot can be filled and then multiply to get the total number of
outcomes
example 1
You take a test with five questions. Each question can be answered True, False or
left Blank. For instance some responses are
TTFBF
TFBBF
FTBBF
How many responses are there?
solution
There are five slots to fill (the five questions). Each can be filled in 3 ways
(with T, F or B). So the number of responses is 3…3…3…3…3 = 35
example 2
The total number of 4—letter words is 26…26…26…26 (each spot in the word can be
filled in 26 ways).
page 2 of Section 1.1
example 3
The total number of 4—letter words that can be formed from 26 different scrabble
chips is 26…25…24…23 (the first spot can be filled in 26 ways, the second in only 25
ways since you have only 25 chips left, etc.).
7 ≈ 7 ≈ 7 versus 7 ≈ 6 ≈ 5
The answer 7 ≈ 7 ≈ 7 is the number of ways of filling 3 slots from a pool of 7
objects where each object can be used over and over again; this is called sampling
with replacement.
The answer 7 ≈ 6 ≈ 5 is the number of ways of filling 3 slots from a pool of 7
objects where an object chosen for one slot cannot be used again for another slot;
this is called sampling without replacement..
example 4
How many 4—letter words do not contain the letter Z.
solution
There are 4 slots and each can be filled in 25 ways. Answer is 254.
example 5
How many 4—letter words begin with TH.
solution
The first two letters are determined so there are only two slots to fill, the last
two letters in the word. Each can be filled in 26 ways so the answer is 26…26.
counting the list "all, none, any combination"
Suppose you buy a car and are offered the options of Air conditioning, Power
windows, Tinted glass, FM radio, Shoulder harnesses. Here are some of the
possibilities:
1. none of the options
2. all of the options
3. just A
4. just P
5. just T
6. A and T
7. A, FM and T
etc.
The problem is to count the total number of possibilities.
Each of the five options is a slot which can be filled in two ways (yes or no).
For example, buying A and T goes with
yes
A slot
no
P slot
yes
T slot
no
FM slot
no
S slot
The answer is 2…2…2…2…2… = 25.
(2)
Given n objects, there are 2n ways to choose all, none, any combination
example 6
There are six books B1,..., B6 you are considering taking on your vacation. You
can take them all; you can take none of them; you can take all except B1 etc. How
many possibilities are there.
solution
The number of possibilities is 26.
page 3 of Section 1.1
the number of subsets of a given set
If Q = {a,b,c} then Q has 8 subsets:
{a}, {b}, {c}, {a,b}, {b,c}, {a,c}, {a,b,c} and the null set ƒ
Look at the set P ={a1,..., a6}.
To count the subsets think of 6 slots named a1,..., a6, each to be filled with IN or
OUT. For example the subset {a2,a3,a5} corresponds to
OUT
IN
IN
OUT
IN
OUT
OUT
OUT
The null subset ƒ corresponds to
OUT
OUT
OUT
OUT
OUT
So there are 26 subsets of P. In general:
A set with n members has 2n subsets
(3)
choosing the best slots
Seven people P1,..., P7 arrive in a city and they can stay at any of three hotels
H1, H2, H3. For instance, here are some of the possibilities.
1. all people in H1
2. P2 in H1; others in H2
3. P1, P5 in H1; P6 in H2; others in H3
I want to find the number of possibilities.
Try the hotels as slots, starting with H1.
One possibility is that everyone stays at H1.
Another possibility is that no one stays at H1.
In fact any combination of the seven people could stay at H1.
So by (2), the H1 slot can be filled in 27 ways.
But then the H2 slot depends on how the H1 slot was filled.
If everyone stays at H1 then there is only one possibility for the H2 slot
(no one stays there).
If no one stays at H1 then by (2) again, there are 27 possibilities for H2.
If P1,..., P6 stay at H1 then there are two possibilities for H2 (P7 or no one).
So there is no way to fill in a single value for the second slot.
false start
good start Use the people as slots (since each person must get a hotel but not
vice versa).
Each person—slot can be filled in 3 ways (with one of the 3 hotels).
The answer is 37.
page 4 of Section 1.1
example 7
An agency has 10 available foster families F1,..., F10
to place. In how many ways can they do this if
(a) no family can get more than one child
(b) a family can get more than one child
and 6 children C1,..., C6
solution
(a) Use the children as slots (since each child must get a family but not every
family must get a child). Answer is 10…9…8…7…6…5.
(b) Use the children as slots. Answer is 106.
example 8
Look at all 6—digit numbers which do not repeat a digit (e.g., 897563, 345678)
Don't count 045678 which is really only a 5—digit number; i.e., leading 0's are not
allowed.
How many are there?
solution
Fill six slots from the 10 available digits. But don't let the first slot be 0.
Answer is 9…9…8…7…6…5.
using total – opposite
Suppose you want to count 4—letter words which contain repeated letters (e.g.,
ABZA, AACA, ZOGO, EEEE). It's easier to count the opposite (complementary) event, that
is to count words without repeats:
words with repeats = total words - words without repeats
= 264 - 26…25…24…23
PROBLEMS FOR SECTION 1.1
(see the back of the notes for the solutions)
1. The library has 4 golf books, 3 tennis books and 6 swimming books.
ways can you bring home three books, one in each sport.
In how many
2. How many 6 digit numbers begin and end with 8.
3. There are 50 states and 2 U.S. Senators for each state. How many committees can
be formed consisting of one Senator from each of the 50 states.
4. Ten people share a house. They need a cook for each day of the coming week. In
how many ways can this be done if
(a) a person can be assigned to cook on more than one day
(b) a person can't get stuck with the job for more than one day
5. In how many ways can 7 people ride a long toboggan if only John and Mary are
skilled enough to steer (the one who steers is the one up front).
6. Seven people fill out application forms. The company will hire those who turn
out to be qualified (e.g., they might end up hiring John and Mary and rejecting the
rest). How many possibilities are there.
7. In how many ways can the symbols A,B,C,D,E,E,E,E,E be arranged in a line so that no
E is next to another E.
8. Four students are going to enroll in college and there are 11 school available.
One possibility is that John, Mary, and Bill go to S5 while Betty goes to S11.
(a) How many possibilities are there.
(b) How many possibilities are there if the four students must go to four different
schools.
page 5 of Section 1.1
9. In how many ways can the letters A,B,C, d,e,f,g be lined up if the capitals must
come first.
10. (a) Three hundred people P1,..., P300 make plane reservations but don't
necessarily show up.
One possibility is the P1 and P2 show but the others are no—shows.
Another possibility is that P1 and P300 show but the others are no—shows.
How many possibilities are there.
(b) Suppose the airline doesn't care about the names of the people who show up but
just how many do. In that case the two possibilities listed in part (a) don't count
as distinct since they both amount to 2 shows and 298 no—shows.
From this point of view how many possibilities are there.
11. Given ten boxes B1,..., B10 and 17 balls b1,..., b17. Toss the balls into the
boxes.
One possibility for instance is
B1 gets b1-b16 , B2 gets b17
(other boxes are empty)
How many possibilities are there.
12. (a) A hotel has 7 vacant single rooms R1,..., R7. If five travelers T1,..., T5
arrive, in how many ways can the desk clerk assign rooms.
(b) Repeat part (a) but with nine travelers (so that 2 will be turned away).
13. How many 4—letter words
(a) begin with Z
(b) begin and end with Z
(c) begin with Z and then contain no more Z's
14. The problem is to count six—digit even numbers with no repeated digits (e.g.,
123456, 948712).
The number can't have a leading zero (can't be 045678) since then it really is
only a 5—digit number, and it must end with an even digit to be an even number.
(a) Look at this attempt.
The first digit can be picked in 9 ways (any of the 10 digits excluding 0).
The next 4 digits can be picked in 9…8…7…6 ways.
So far so good but what's the problem in picking the last digit?
(b) Try again!
The last digit can be picked in 5 ways (there are 5 even digits).
The middle 4 digits can be picked in 9…8…7…6 ways.
So far so good but what's the difficulty in picking the first digit.
(c) Try again by breaking the original problem into cases to avoid the
difficulties that turned up in (a) and (b).
15. In a certain programming language a name may consist of a single letter or a
letter followed by up to 6 symbols which may be letters or digits (e.g., X, Z, R2D2,
XX1234). How many names are there.
page 1 of Section 1.2
SECTION 1.2
PERMUTATIONS AND COMBINATIONS
review of factorials
n! = n(n-1)(n-2)...1 if n is a positive integer (definition)
0! = 1 (definition)
For example
6! = 6…5…4…3…2…1 = 720
10!
10…9…8…7…6…5…4…3…2…1
=
= 10…9…8 = 720
7!
7…6…5…4…3…2…1
5! ≈ 6 = 6!
a deck of cards
A deck of cards contains 13 faces (values), namely Ace, King, Queen, Jack, 10,9,...,2
and four suits, namely Spades, Diamonds, Hearts, Clubs.
The pictures are Ace, King, Queen, Jack.
A poker hand contains 5 cards.
A bridge hand contains 13 cards.
permutations (lineups)
Consider 5 objects A1,..., A5.
To count all possible lineups (permutations) such as A1A5A4A3A2 , A5A3A1A2A4
etc., think of filling 5 slots, one for each position in the line, and note that
once an object has been picked, it can't be picked again. The total number of lineups
is 5…4…3…2…1 or 5!.
In general:
n objects can be permuted in n! ways
Suppose you want to find the number of permutations of size 5 chosen from the 7
items A1,..., A7, e.g., A1A4A2A6A3, A1A6A7A2A3.
There are 5 places to fill so the answer is 7…6…5…4…3, or, in more compact notation,
7!/2!.
example 1
Ten people can be lined up (permuted) in 10! ways.
A permutation of 4 out of the 10 can be chosen in 10…9…8…7 ways.
matchups of same–size groups
Given 4 adults A1,..., A4 and 4
matchups.
1. A1 & C4, A2 & C2,
2. A1 & C3, A2 & C1,
children C1,..., C4.
A3 & C3,
A3 & C4,
Here are some possible
A4 & C1
A4 & C2
To count the total number of matchups take either the adults or the children to be
the slots. If the adults are the slots then A1 can be filled with any of 4 children,
A2 with any of the 3 remaining children etc. Answer is 4…3…2…1.
The number of ways to match two groups of size n is n!
page 2 of Section 1.2
combinations (committees)
Order doesn't count in a committee; it does count in a permutation.
A1, A17, A2, A12 is the same committee as A12, A1, A17, A2
A12A1A17A2 are different permutations.
but A1A17A2A12 and
n
The symbols (r), called a binomial coefficient, stands for the number of committees
of size r that can be chosen from a population of size n, or equivalently, the
number of combinations of n things taken r at a time. Its value is given by
n
n!
(1)
(r) =
r! (n-r)!
For example the number of 4—person committees that can be formed from a group of 10
is
10
10!
10…9…8…7…6…5…4…3…2…1
10…9…8…7
(4) =
=
=
= 10…3…7 = 210
4! 6!
4…3…2…1 6…5…4…3…2…1
4…3…2…1
notation
n
( r)
(pronounced n on r ) is also written as C(n,r).
why (1) works
I'll do it for a committee of size 4 from a population of P1,..., P17.
The number of lineups of size 4 from P1,..., P17 is 17…16…15…14. To get the committee
answer, compare lineups with committees.
list of committees
(a) P1, P7, P8, P9
list of lineups
(a1)
(a2)
P1P7P8P9
P7P1P9P8
(b1)
(b2)
P3P4P12P6
P4P12P3P6
»
(a24) P9P9P1P8
(b) P3, P4, P12,P6
there are 4!
of these
»
(b24) P12P3P4P6)
etc.
there are 4!
of these
Each committee gives rise to 4! lineups so
number of committees ≈ 4! = number of lineups
number of committees =
number of lineups
4!
=
17…16…15…14
4!
=
17!
4! 13!
example 2
A library has 100 books. In how many ways can you check out 3 of them.
solution
Each threesome is a committee of 3 books out of 100. The answer is
100
100!
( 3 ) =
3! 97!
=
100…99…98
3…2…1
= 161700
QED
page 3 of Section 1.2
n
some properties of ( r )
n
(r)
(2)
(3)
n
(1) =
17
For example ( 4 ) =
This holds because
leaves a committee
committees of size
same length.
17
In particular ( 4 )
n
(n-1) = n
n
(n) = 1
(4)
(5)
n
= (n-r)
n
(0) = 1
17
(13).
picking a committee of size 4 automatically
of 13 leftovers and vice versa so the list of
4 and the list of committees of size 13 are the
and
17
(13) are each
17!
.
4!13!
There are n committees of size 1 from a population of n.
There is one committee of size n from a population of n.
n
(0) =
n!
n! 0!
=
1 because 0! is defined as 1.
example 3
52
A poker hand is a committee of 5 chosen from 52 so there are ( 5 ) poker hands.
example 4
How many poker hands contain the queen of spades.
solution
Since the hand must contain the spade queen, the problem amounts to picking the
rest of the hand, a committee of size 4 from the 51 cards left in the deck.
51
Answer is ( 4 ).
example 5
How many poker hands do not contain the queen of hearts.
sollution
method 1
method 2
51
Choose 5 cards from the 51 non—queen—of—hearts. Answer is ( 5 ).
number of hands without queen of hearts
= total number of hands - number with queen of hearts
52
51
= (5 ) - (4 )
(from examples 3 and 4)
example 6
How many poker hands contain only hearts.
solution
13
Choose a committee of 5 hearts from the 13 hearts in the deck. Answer is ( 5 ).
example 7
How many poker hands contain only hearts and include the king of hearts.
solution
12
Choose 4 more hearts from the remaining 12 to go with the king. Answer is ( 4 ).
page 4 of Section 1.2
example 8
How many poker hands contain only pictures but don't include the queen of spades.
solution
Choose 5 cards from the 15 non—spade—queen pictures
15
Answer is ( 5 ).
example 9
How many poker hands contain 4 spades and the 2 of hearts.
solution
13
Choose 4 spades from 13. Answer is ( 4 ).
9
9 ≈ 8 ≈ 7 versus (3 )
Both count the number of ways in which 3 things can be chosen from a pool of 9.
But 9 ≈ 8 ≈ 7 corresponds to choosing the 3 things to fill slots (such as president,
9
vice-president,secretary) while (3) corresponds to the case where the 3 things are
not given names or distinguished from one another in any way (such as 3 co-chairs)
From a committee/lineup point of view, 9 ≈ 8 ≈ 7 counts lineups of 3 from a pool
9
of 9 while (3) counts committees.
notation
The symbol P(9,3) is often used for the number of permutations of 3 out of 9. So
9!
P(9,3) = 9…8…7 =
6!
The symbols C(9,3) and Binomial[9,3] are often used
3 out of 9. So
9
9!
C(9,3) = (3) =
3! 6!
for the number of committees of
example 10
Given 3 girls and 7 boys. How many ways can 3 marriages be arranged.
For example, one possibility is
solution
method 1
G1 & B2,
G2 & B7,
G3 & B4
Take the girls as slots.
Answer is 7…6…5.
First pick 3 of the 7 boys. Then match the 3 chosen boys with the 3
7
girls. Answer is (3)…3!.
7
7!
7!
The two answers agree since (3)…3! =
3! =
= 7…6…5
3! 4!
4!
method 2
PROBLEMS FOR SECTION 1.2
1. An exam has 20 questions and you are supposed to choose any 10.
(a) In how many ways can you make your choice.
(b) In how many ways can you choose if you have to answer the first four questions
as part of the 10.
2. How many poker hands contain
(a) only spades
(b) only pictures
(c) no hearts
(d) the ace of spades and the ace of diamonds (other aces allowed too)
(e) the ace of spades and the ace of diamonds and no other aces
page 5 of Section 1.2
3. Four men check their hats and the hats are later returned to the men at random.
One possibility is
M1 gets H2,
M2 gets H3,
M3 gets H1,
M4 gets H4
(a) How many possibilities are there.
(b) How many possibilities end with some dissatisfaction, i.e., some mismatch.
4. From a population of 10 men and 7 women how many ways are there to
(a) pick a King and Queen
(b) pick a president and vice-president
(c) pick two delegates
(d) award the good fellowship medal and the achievement medal
5. Compute
7!
7
8
5
12345
12345
(a)
(b) (5) (c) (5)/(2) (d) ( 1 ) (e) ( 0 )
5!
5
(3)
5 4 3
6. Show that
is the same as 10 9 8 .
10
(3 )
n+m-1
( n-1 )
7. Simplify
.
n+m
( n )
12345
(f) (12344)
12345
(g) (12345)
8. In how many ways can an employment agency match up 10 families and 6 nannies
(with 4 families left over).
9. Consider committees of size 6 from the population A1,..., A10.
(a) How many contain both A1 and A7.
(b) How many do not contain both A1 and A7.
page 1 of Section 1.3
SECTION 1.3 PERMUTATIONS AND COMBINATIONS CONTINUED
example 1
Find the number of poker hands with 2 Jacks.
solution
Pick 2 Jacks of the 4 Jacks
Pick the 3 remaining cards from the 48 non-Jacks
4
48
Answer is (2) ( 3 ).
example 2
Find the number of poker hands with 2 Jacks and one Ace.
solution
Pick 2 of the 4 Jacks
Pick 1 of the 4 Aces
Pick the remaining 2 cards from the 44 non-Ace-non-Jacks
4
44
Answer is (2)…4…( 2 ).
example 3
Find the number of committees of size 10 with 5 Men, 3 Women, 2 Children
that can be picked from a population of 20 Men, 25 Women, 30 Children.
solution Pick 5 from the 20 Men.
Pick 3 from the 25 Women.
Pick 2 from the 30 Children.
20 25 30
Answer is ( 5 )( 3 )( 2 ).
example 4
How many 8 digit strings contain exactly three 2's (e.g., 02322366).
solution
Pick 3 positions in the string for the 2's.
Fill the remaining 5 positions from the other 9 digits.
8
Answer is (3) … 95.
example 5
How many poker hands contain only one suit.
solution
13
Can pick the suit in 4 ways. Can pick the 5 cards from that suit in ( 5 ) ways.
13
Answer is 4( 5 ).
example 6
Look at strings of digits and letters of length 7.
How many contain 2 digits, 4 consonants and 1 vowel if
(a) repetition is not allowed (e.g., z2ctaf3 is OK but z2zzaf3 is no good)
(b) repetition is allowed (e.g., 22zzyya is OK)
solution
(a) method 1
Pick 2 digits, 4 consonants, 1 vowel and then line them up
10 21
Answer is ( 2 )( 4 )…5…7!.
method 2 (perhaps better because it carries over into the case where repetition
is allowed)
7
Pick 2 positions in the string for the digits. Can be done in (2) ways.
5
Pick 4 positions for the consonants, leaving one for the vowel. (4) ways.
Then fill the spots. Digit spots can be filled in 10…9 ways, consonant spots can
be filled in 21…20…19…18 ways, vowel spot can be filled in 5 ways,
7 5
Answer is (2)(4)…10…9…21…20…19…18…5.
page 2 of Section 1.3
(b) The first method from part (a) doesn't work here.
First of all you don't have a rule yet for counting how many ways you can pick
a committee of digits and letters when a digit or letter can be picked more than
once.
Secondly, if the picks were say 2,7,Z,Z,Z,C,E you don't have a rule yet for
permuting them because of the three identical Z's. And even if you had such a rule
you would need cases because the picks might include repetition (e.g., 2,7,Z,Z,Z,C,E)
or might not (e.g., A,B,C,5,D,3,E).
Here's a method that will work.
Pick two positions for the digits, four for the consonants, one for the vowel.
Then fill the spots.
7 5
Answer is (2)(4)…102 …214 … 5.
permutations with some objects kept together
Given ten people P1,..., P10. In how many ways can they can be lined up so that
P2, P6, P9 are together; e.g., one possibility is
P1P3P5P4 P2P9P6 P10P8P7
Temporarily think of the trio as a single item so that you have 7 loners and one
trio. These 8 things can be lined up in 8! ways. Then rearrange the 3 within the
trio in 3! ways.
Answer is 8! 3!.
permutations with some objects kept apart
Suppose you want to line up 7 girls and 3 boys so that no two boys are together.
Start by lining up the 7 girls. Can be done in 7! ways (Fig 1).
FIG 1
There are 8 spaces in between and at the ends in Fig 1. To keep the boys apart
put the 3 boys in 3 of the 8 spaces. This can be done in 8…7…6 ways (each boy is a
8
slot) or alternatively in (3)…3! ways (choose 3 spaces and then match them with the
3 boys).
8
Answer is 7!…8…7…6 or equivalently 7!(3)…3!.
To keep enemies apart, first line up the others and
then select between/end places for the enemies.
example 7
How many permutations of the 26 letters of the alphabet have the vowels (A,E,I,O,U)
together, have P,Q,R together and have X,Y,Z apart (i.e., no two of them together).
solution
First permute the 23 letters A-W with vowels together and P,Q,R together. To count
these perms, line up a vowel clump, a PQR clump and the other 15 letters. That's a
total of 17 things. Then permute within the vowel clump and within the PQR clump.
Can be done in 17! 5! 3! ways.
Now there are 18 between/ends where X,Y,Z could go. Pick places for them. Can be
done in 18…17…16 ways.
Final answer is 17! 5! 3! 18…17…16
page 3 of Section 1.3
double counting
(1)
WRO
NG
A poker hand with 2 pairs has say 2 Jacks, 2 Kings and then a fifth card which is
not a Jack and not a King. I'll show you an incorrect way to count the number of
poker hands with two pairs. The important thing it to understand why it's wrong.
step 1
step 2
step 3
Pick a face value and then pick 2 in that face.
Pick another face value and then pick 2 cards in that face.
Pick a 5th card from the 44 not of the two chosen faces
(to avoid a full house).
4
4
Answer is 13…(2)…12…(2)…44.
This is wrong because it counts the following as different outcomes when they are
really the same hand:
outcome 1
Pick Queen, hearts and spades.
Pick Jack, hearts and clubs.
Pick Ace of clubs.
outcome 2
Pick Jack, hearts and clubs.
Pick Queen, hearts and spades.
Pick Ace of clubs.
This incorrect method uses "first face value" and "second face value" as slots but
the faces can't be designated "first" and "second" so they can't be used as two
slots.
The wrong answer in (1) counts every outcome twice.
Here's a correct version.
step 1 Pick a committee of 2 face values for the pairs.
step 2 Pick 2 cards from each face value.
step 3 Pick a fifth card from the 44 not of either face.
13 4 4
Answer is ( 2 )(2)(2)…44.
Another correct method is to take the wrong answer from (1) and convert it to a
1
4
4
right answer by taking half, i.e., the answer is 2 …13…(2)…12…(2)…44.
In general, an "answer" which counts some outcomes more than once is referred to as a
double count (the double count in (1) happens to count every outcome exactly twice).
Double counts can be hard to resist.
warning
7
A common mistake is to use say 7…6 instead of (2), i.e., to implicitly fill slots
named first thing and second thing when you should just be picking a committee of
two things.
PROBLEMS FOR SECTION 1.3 (Make sure you look at the last problem.)
1. An exam offers 20 questions and you have to choose 2 of the first 5 and 8 from
the next 15. In how many ways can you choose the 10 questions you'll answer.
2. In how many ways can you choose a committee of 2 men and 3 women from a group of
7 men and 8 women.
page 4 of Section 1.3
3. How
(a) 2
(b) 3
(c) 4
(d) 2
(e) 4
4.
(a)
(b)
(c)
many poker hands contain
spades (meaning exactly 2 spades) one of which is the ace
diamonds and 2 hearts
black and 1 red
aces (meaning exactly 2 aces)
aces and no kings
How many license plates are there if a license plate contains
3 digits and 2 letters in any order(repetition allowed)
3 digits and 2 letters in any order, repetition not allowed
2 letters followed by 3 digits (repetition allowed)
5. Five
(a) In
(b) In
(c) In
people will be chosen from a group of 20 to take a trip.
how many ways can it be done.
how many ways can it be done if A and B refuse to travel together.
how many ways can it be done if A and B refuse to travel without each other.
6. In how many ways can 20 books B1,..., B20 be distributed among 4 children so that
(a) each child gets 5 books
(b) the two oldest get 7 books each and the two youngest get 3 each
7. Start with 3 men, M1, M2, M3, 7 women, W1, ..., W7 and 8 children, C1, ..., C8.
How many committees of size 5 can be formed containing
(a) no men
(b) M3
(c) M3 and no other men
(d) M3 and two women
(e) M3, W1, W7
(f) one man
8. Given 10 men, 20 women and 30 children.
(a) How many committees of size 6 contain 3 men.
(b) How many lineups of size 6 contain 3 men.
9. There are 50 states and 2 senators from each state. The President invites 25
senators to the White House. In how many ways can this be done so that 25 different
states are represented.
10. In how many ways can you select 3 people from a group of 4 married couples
C1, C2, C3, C4 so as to not include a pair of spouses.
11. (a) How many strings of 12 digits and/or letters contain 3 even digits
(e.g., B57XYZZ 4 4 C 2 3, 0429A8 ).
(b) Repeat part (a) if repetition is not allowed.
12. A child asks for a bicycle, a doll, a book and candy for her birthday. Assuming
she'll get something but not necessarily everything she's asked for, how many
possibilities are there.
13. A word is a palindrome if it reads the same backwards as forwards.
(a) How many palindromes are there of length 5 (e.g., xyzyx, kkkkk)? length 6?
(b) In a palindrome, some letters naturally must appear twice. If we insist that
letters cannot appear more than twice how many palindromes are there of length 5? of
length 6?
page 5 of Section 1.3
14. Start with 15 people. In how many ways can you
(a) invite 4 for dinner
(b) choose 4 to be president, vice—president, secretary and treasurer of your club
(c) lend them 4 books titled A,B,C,D so that no person gets more than one book
(d) lend them 4 books A,B,C,D allowing people to get more than one book
(e) pick 5 to be on a basketball team and 4 to cheer for them.
(f) pick 5 to play basketball in the winter and 4 to play football in the fall
(g) divide them into 9 to play baseball, 2 to umpire and 4 to cheer
15. How many poker hands contain one ace.
16. How many permutations of A1,A2,A3,A4, B1,B2,B3 have the A's in ascending order and
the B's in ascending order (e.g., A1B1B2A2A3A4B3, A1A2B1B2A3B3A4 ).
17. There are 5 women W1,..., W5 and 9 men M1,..., M9 at a dance.
(a) In how many ways can the women choose dance partners (e.g., one possibility is
W1M2, W2M7, W3M5, W4M4, W5M9 with wallflowers M1, M3, M6, M8 ).
(b) The answer to part (a) was not 5…9. What counting problem is 5…9 the answer to.
18. How many permutations of the letters A,B,C,D,E,F have B directly between A and C
(e.g., D CBA EF, ABC FED).
19. You can order a hamburger with ketchup, mustard, pickle, relish, onion. How many
possible hamburger orders are there.
20. How many poker hands contain
(a) four aces
(b) four of a kind (e.g., 4 Jacks)
21. A room has a row of 7 seats S1,..., S7. Four people P1,..., P4 sit down.
(a) In how many ways can they be seated.
(b) In how many ways can they be seated consecutively (i.e., with no empty seats
in between).
22. How many committees of size 5 including a designated chairperson can be formed
from a population of size 15.
23. 10 boys and 6 girls will sit in a row.
(a) In how many ways can it be done if the 6 girls sit together.
(b) In how many ways can it be done if no two girls sit together.
(c) Why can't you do (b) by taking total - answer to (a).
24. Three Democrats, 5 Republicans, 6 Socialists and 7 uncommitteds will stage a
(single—file) protest march. In how many ways can it be done if
(a) each political group (but not the uncommitteds) sticks together
(b) the Dems are first, Republicans next, Socialists next and uncommitteds last
25. How many permutations of the alphabet have
(a) A,B,C together
(b) D,E not together
(c) A,B,C together and D,E together
(d) A,B,C together and D,E not together
26. John and Mary play 5 sets of tennis. How many outcomes are there if
(a) an outcome is a report of who wins what set (e.g., John wins 1st and 3rd and
Mary wins the others)
(b) an outcome is a report of who wins how many sets (e.g., Mary wins 3 sets and
John wins 2 sets)
27. How many permutations of the 26 letters of the alphabet contain the string
page 6 of Section 1.3
mother (for example, the usual order abcde...xyz does not contain mother).
28. How many 3—card hands contain 3 of a kind (i.e., 3 of the same face) (e.g.,
Queen of hearts, spades, clubs; 3 of diamonds, clubs, spades).
29.
(a) How many 4—card hands contain 2 pairs.
(b) How many 5—card hands contain a full house (3 of a kind and a pair).
30. A club with 50 members is going to form a finance committee.
(a) If the size hasn't been determined yet except for the fact that someone will
be on it and not everyone will be on it, how many possibilities are there.
(b) How many possibilities are there if the committee will contain anywhere from 2
to 6 members.
31. Given 23 points in the plane.
(a) How many lines do they determine if no three of the points are collinear.
(b) What happens if the collinearity hypothesis is removed from part (a).
32. Look at samples of size 3 chosen from A1,..., A7.
(a) How many samples are there if the samples are chosen with replacement (after an
item is selected, it's replaced before the next draw so that A1 for instance can be
drawn more than once) and order counts (e.g., A2A1A1 is different from A1A2A1)
(b) How many samples are there if the drawing is without replacement and order counts.
(c) How many samples are there if the drawing is w/o replacement and order doesn't count.
(d) What's the 4th type of sample (counting here is tricky————coming up soon).
33. Here are some counting problems with proposed answers that double count.
Explain how they double count (produce specific outcomes which are counted as if
they are distinct but are really the same) and then get correct answers.
(a) To count the number of poker hands with 3 of a kind:
step 1 Pick a face value and 3 cards from that value.
step 2 Pick one of the remaining 48 cards not of that value (to avoid 4 of a
kind).
step 3 Pick one of the remaining 44 not of the first or second value (to avoid 4
of a kind and a full house).
4
Answer is 13…(3)…48…44. WRONG
(b) To count the number of 3—letter words containing the letter z (e.g., zzz, zab,
baz, zzc):
step 1 Pick one place in the word for the letter z (to be sure it appears).
step 2 Fill the other 2 places with any of the 26 letters (allowing more z's).
Answer is 3…26…26. WRONG
(c) To count 7—letter words with 3A's:
step 1 Pick a spot for the first A.
step 2 Pick a spot for the second A.
step 3 Pick a spot for the third A.
step 4 Fill each of the remaining 4 places with any of the non—A's.
Answer is 7…6…5…254. WRONG
(d) To count 2—card hands not containing a pair:
step 1 Pick any first card.
step 2 Pick a second card from the 48 not of the first face value.
Answer is 52…48. WRONG
(e) To count the number of ways to
step 1 Pick a man and woman for
step 2 Pick a man and woman for
step 3 Pick a man and woman for
Answer is 10…8…9…7…8…6. WRONG
form 3 coed couples from 10 men and 8 women:
the first couple.
the second couple.
the third couple.
page 1 of Section 1.4
SECTION 1.4 PERMUTATIONS OF NOT-ALL-DISTINCT OBJECTS
permutations if not all objects are distinct (anagrams)
The number of permutations of
3 X's, 4 Y's, 6 Z's, and 1 each of A, B, C, D, E
is
(18 letters total)
18!
3! 4! 6!
More generally, if among n objects there are
n1 identical ones of one type,
n2 identical ones of a second type
»
n5 identical ones of a fifth type
and perhaps some other unique objects then the number of
permutations (anagrams) of the n objects is
(1)
n!
n1! n2! n3! n4! n5!
why (1) works
version 1
Look at permutations say of 3 A's, 2 B's, 2 C's D, E, F (10 letters total).
There are 10 spots on the line to fill.
10
Pick 3 of the spots for the A's. Can be done in (3 ) ways.
7
Pick 2 spots for the B's from the remaining 7 places. Can be done in (2) ways.
5
Pick 2 spots for the C's from the remaining 5 places. Can be done in (2) ways.
The other 3 spots on the line and the 3 distinct letters can be matched in 3!
ways.
10
7
5
10!
7!
5!
10!
Number of perms = (3 ) (2) (2) 3! =
3! =
3! 7! 2! 5! 2! 3!
3! 2! 2!
version 2
There are 10! perms of the 10 distinct letters A1, A2, A3, B1, B2, C1, C2 D, E, F.
To get the number of permutations of the original 10 not-all-distinct letters, compare
the following two lists.
perms of non-distincts
(a) AAABBFDECC
(b) ABABCCADEF
etc.
perms of distincts
(a1) A1A2A3B1B2FDEC1C2
(a2) A2A1A3B1B2FDEC1C2
(a3) A2A1A3B2B1FDEC1C2
.
.
.
(b1) A1B1A2B2C1C2A3DEF
(b2) A2B1A1B2C1C2A3DEF
(b3) A3B2A1B1C2C1A2DEF
.
.
.
there are
3! 2! 2!
of these
there are
3! 2! 2!
of these
page 2 of Section 1.4
Each perm on the left gives rise to 3!2!2! perms on the right. So
Number of perms of non—distincts ≈ 3!2!2! = number of perms of distincts.
10!
Number of perms of non—distincts =
QED
3! 2! 2!
example 1
How many permutations are there of the word APPLETREE.
solution
The 9—letter word contains 2 P's, 3 E's, A,L,R,T. Answer is
9!
.
2! 3!
example 1 continued
In how many of those permutations are the 3 E's together.
solution
Imagine that you have 7 objects, namely 2 P's, A,L,R,T and a clump of E's.
7!
By (1) they can be permuted in
ways
2!
example 1 continued again
In how many of those permutations are the letters A, L, R together.
solution
Imagine that you have 7 objects, namely 2 P's, 3 E's, T and an ALR clump.
7!
By (1) they can be permuted in
ways. And then the ALR clump can be
2! 3!
rearranged in 3! ways.
7!
7!
Answer is
… 3! =
.
2! 3!
2!
example 2
In how many ways can the complete works of Shakespeare in 10 volumes and 6 copies
of Tom Sawyer be arranged on a shelf.
solution
This is a permutation of 16 objects, 6 of which are identical. Answer is
16!
.
6!
PROBLEMS FOR SECTION 1.4
1. How many permutations can be made using 3 indistinguishable white balls, 7
indistinguishable black balls and 5 indistinguishable green balls.
2. How many permutations are there of
(a) HOCKEY
(b) FOOTBALL
3. Look at all permutations of SOCIOLOGICAL
(a) How many have the vowels adjacent
(b) How many have the vowels in alphabetical order (but not necessarily adjacent);
e.g., S A I C I L O C O G L O
(c) How many have the vowels adjacent and in alphabetical order.
page 3 of Section 1.4
4. Suppose you want to count all 4—letter words containing 2 pairs (e.g., ADAD, QQSS,
DAAD)
(a) What's wrong with the following attempt.
step 1 Pick a letter for the first pair. Can be done in 26 ways.
step 2 Pick a letter for the second pair. Can be done in 25 ways.
step 3 Arrange the 4 letters (2 of one kind and 2 of another kind).
4!
Can be done in
.
2! 2!
4!
Answer is 26…25…
. WRONG
2! 2!
(b) What's the right answer.
5. How many permutations of 4 plus signs, 4 minuses and 3 crosses have a plus in the
middle (e.g., + + - ≈ - + ≈ + - ≈ - ).
6. Consider strings of length 10 from the alphabet A,B,C.
(a) How many are there.
(b) How many have 3 A's, 4 B's and 3 C's.
(c) How many have 3 A's.
7. Consider permutations of APPLETREE.
(a) How many have no adjacent E's.
(b) How many have none of A, L, R adjacent.
(c) How many have A, L, T together and no consecutive E's.
page 1 of Section 1.5
SECTION 1.5
COMMITTEES WITH REPEATED MEMBERS
(INDISTINGUISHABLE BALLS INTO DISTINGUISHABLE BOXES)
the stars and bars formula
Consider committees of size 3 chosen from A1,..., A7 with repetition allowed.
For example some possibilities are
A2, A2, A3; i.e., 2 A2's and an A3
A1, A5, A7; i.e., one each of A5, A1, A5, A7
Equivalently, consider unordered samples of size 3 chosen with replacement from a
population of size 7.
7+3-1
9
I'll show that there are ( 3 ) = (3) such committees.
The key idea (Fig 1) is that choosing a committee is like tossing 3
indistinguishable balls into 7 distinguishable boxes. For example, the committee
A5, A5, A6 corresponds to 2 balls in box A5 and 1 ball in box A6.
Furthermore the ball—in—boxes problem can be thought of as lining up 3 stars and 6
bars (the inside walls of the boxes). By (1) in the preceding section this can be
9!
9
done in
= (6) ways.
3! 6!
sample
ball-in-box version
A1 A2 A3 A4 A5 A6 A7
•
• •
A ,A ,A
5
5
6
A1, A
2,
A
stars and bars version
7
•
•
A4 , A , A
4
4
•
•
••
* *
* *
*
*
** *
FIG 1
Here's the general result.
The following are the same:
The number of committees of size k chosen from a population of size n
with repetition allowed.
(1)
The number of ways of tossing k indistinguishable balls into n
distinguishable boxes.
n+k-1
And that number is (
)
k
Note that since repetition is allowed on the committee, it's possible for k, the size
of the committee, to be larger than n, the size of the population.
page 2 of Section 1.5
example 1
A school district encompasses four schools S1, ..., S4.
The district receives 9 blackboards.
In how many ways can the (identical) blackboards be distributed to the schools.
solution
The 4 schools are distinguishable boxes into which the 9 blackboards/balls are
4+9-1
12
tossed. Answer is ( 9 ) = ( 9 ).
warning
4+9-1
1. In example 1 the answer is not ( 4 ). Of the two numbers 4 and 9, the one
chosen for the lower spot in the formula is the one corresponding to the number of
indistinguishable balls (i.e., to the size of the committee) and is not necessarily
the smaller of the two numbers.
2. In example 1, the blackboards can't be used as slots since they are
indistinguishable.
Indistinguishable objects can't serve as slots.
example 2
A child has a repertoire of 4 piano pieces P1,..., P4.
Her parents insist that she practice 10 pieces a day. For example one practice
session might consist of P3 played 7 times (tra la la) and P1 played 3 times.
(a) How many practice session are there.
(b) How many sessions are there if she must play P2 at least 3 times.
(c) How many session are there if she must play P2 exactly 3 times.
(d) How many sessions are there if she has to play each piece at least once.
solution
(a) Each session is a committee of size 10 chosen from the repertoire of size 4
10+4-1
13
with repetition allowed. Answer is ( 10 ) = (10).
(b) After P2 is played 3 times, the rest of the session is a committee of size 7
7+4-1
chosen from 4 (allow P2 to be chosen again). Answer is ( 7 ).
(c) After P2 is played 3 times, the rest of the session is a committee of size 7
7+3-1
chosen from 3 (don't allow P2 to be chosen again). Answer is ( 7 ).
(d) Play each piece once. Then the rest of the session is a committee of 6 chosen
6+4-1
from 4. Answer is ( 6 ).
example 3
A bakery sells chocolate chip cookies, peanut butter cookies, sugar cookies and
oatmeal cookies. In how many ways can you buy 7 cookies.
solution
You're choosing a committee of size 7 from a population of size 4 with repetition
7+4-1
allowed. Answer is ( 7 ).
example 4
A bakery has 27 chocolate chip cookies, 28 peanut butter cookies, 29 sugar
cookies and 65 oatmeal cookies. In how many ways can you buy 7 cookies.
solution
This is the same as example 3. The numbers 27, 28, 29, 65 are irrelevant as long
as they are ≥ 7 so that you can buy as many of each kind of cookie as you like.
See "at mosts" later in this section for what happens when they aren't irrelevant.
page 3 of Section 1.5
non-negative integer solutions to an equation of the form x1+ ... + xn = k
Look at the equation
x + y + z = 12
where x,y,z are non—negative integers. For example one solution is x=2, y=3, z=7;
another solutions is x=0, y=0, z=12.
To count the number of solutions think of x,y,z as distinguishable boxes into
which 12 indistinguishable balls are tossed. (The solution x=2, y=3, z=7 corresponds
3+12-1
to 2 balls in the x box, 3 in the y box, 7 in the z box.) The answer is ( 12 ).
at leasts
Here are three problems that are all the same:
How many non—neg integer solutions to x1 + ... + x4 = 18
have x2 ≥ 7.
If a bakery sells 4 kinds of cookies in how many ways can
you choose 18 including at least 7 oatmeal
In how many ways can 18 indistinguishable balls be tossed
into 4 distinguishable boxes if the second box must get at
least 7 balls.
For the first version, start x2 at 7 and then count solutions to x1 + ... + x4 = 11.
For the second version buy 7 cookies and choose the remaining 11 from the 4 types
of cookies
For the third version put 7 balls into box 2 and then toss the 11 others into the
4 boxes
11+4-1
The answer in each case is ( 11 ).
at leasts continued
In how many ways can you toss 17 indistinguishable balls into 5 distinguishable
boxes so that each box gets at least two balls.
Put two ball into each box (there's just one way to do this since the balls don't
have names). Toss the remaining 7 balls into the 5 boxes.
7+5-1
Answer is ( 7 ).
warning
This (easy) way of doing "at leasts" won't work with distinguishable balls or
cookies. See Section 1.7 for what happens in that type of problem.
at mosts
A bakery sells chocolate cookies, peanut butter cookies, sugar cookies and
oatmeal cookies.
You want to buy 18 cookies. In how many ways can it be done if the bakery has only
3 chocolates left (and an unlimited supply of the other 3 kinds).
This amounts to choosing a committee of size 18 from a population of size 4 with
the restriction that the committee contain 3 or fewer chocolates, i.e., at most 3
chocs.
method 1
at most 3 chocs = 3 or fewer chocs = total - 4 or more chocs
18+4-1
The total is ( 18 ).
To count "4 or more chocs" (i.e., at least 4 chocs), reserve 4 places on the
committee for chocs and then pick 14 more from the 4 kinds (allowing more chocs);
14+4-1
can be done in ( 14 ) ways.
18+4-1
14+4-1
Answer is ( 18 ) - ( 14 ).
page 4 of Section 1.5
method 2
N(at most 3 chocs) = N(no chocs) + N(1 choc) + N(2 chocs) + N(3 chocs)
18+3-1
17+3-1
16+3-1
15+3-1
= ( 18 ) + ( 17 ) + ( 16 ) + ( 15 )
betweens
Toss 70 indistinguishable balls into 5 distinguishable boxes. In how many ways can
it be done so that box 1 gets between 30 and 50 balls.
method 1
Between 30 and 50 in box 1 = 30 balls into box 1 + 31 balls into box 1
+ ... + 50 balls into box 1
For "30 balls into box 1", put 30 into box 1 and toss the other 40 into the
40 + 4 - 1
remaining four boxes. Can be done in ( 40
) ways.
»
For "50 balls into box 1", put 50 into box 1 and toss the other 20 into the
20 + 4 - 1
remaining four boxes. Can be done in ( 20
) ways.
Answer is
40
¢n=20
n + 4 - 1
(
)
n
method 2 (better)
Look at the Venn diagram to see that
between 30 and 50 in box 1 = 30 or more in box 1 - 51 or more in box 1
= at least 30 in box 1 - at least 51 in box 1
For "30 or more", put 30 into box 1 and toss the other 40 into the five boxes.
40 + 5 - 1
Can be done in (
) ways.
40
Similarly for "51 or more".
40 + 5 - 1
19 + 5 - 1
Answer is (
) - (
)
40
19
30 or more
between
30 and 50
51 or more
Check with Mathematica:
Binomial[40 + 5 - 1,40] - Binomial[19 + 5- 1,19]
126896
Sum[Binomial[n + 4 - 1,n],{n,20,40}]
126896
PROBLEMS FOR SECTION 1.5
1. A concert promoter has 1000 unreserved grandstand seats to distribute (free)
among Alumni, Students, Faculty, Public. For example one possibility is to give half
to the Students and half to the Faculty (Public and Alumni be damned). How many
possibilities are there.
page 5 of Section 1.5
2. Toss a die 19 times. For each toss the die can come up 1,2,3,4,5 or 6.
A histogram records how many times each outcome turns up. One possibility is shown
in the diagram. How many possible histograms are there.
•
•
•
•
•
•
•
1
•
•
•
2
•
••
•
3 4
•
•
•
5
•
•
6
Problem 2
3. (a) In how many ways can 20 coins be picked from 4 large boxes filled
respectively with pennies, nickels, dimes, and quarters.
(b) Why did part (a) say "large" boxes and how large is "large".
4. In how many ways can 12 balls be tossed into 5 distinct boxes if
(a) the balls are indistinguishable
(b) the balls are all different colors
(c) 8 of the balls are red (indistinguishable from one another) and 4 are white
(indistinguishable from one another)
5. In how many ways can one quarter, one dime, one nickel and 25 pennies be
distributed among 5 people.
6. A box contains balls B1, B2, ..., B10. Draw 6. I don't care about the order in
which they are drawn. How many possibilities are there if the drawing is
(a) without replacement (b) with replacement
7. You're taking six courses, C1,..., C6.
For each course you will get a grade of A, B, C, D or E.
How many possible report cards can you get if
(a) the report lists the grade in each course so that one possibility is A's in C1
and C4, B in C2, C's in the rest.
(b) the report is less detailed and only lists the overall results so that one
possibility is 2 A's, 1 B, 3 C's
8. A car dealer has 5 models in stock: 7 M1's, 8 M2's, 9 M3's, 10 M4's and 12 M5's.
Your company is going to buy 6 cars. For instance one possibility is 3 M1's, an M2
and 2 M5's.
(a) How many possible ways are there to buy the 6 cars.
(b) How many possibilities include exactly 2 different models (e.g., 4 M2's, 2 M5's).
(c) How many possibilities include as many different models as possible.
9. You have 6 (identical)
of 20 children.
(a) In how many ways can
(b) In how many ways can
two bats.
(c) In how many ways can
bats and 7 (identical) baseballs to give away to a group
it be done.
it be done if no child gets two balls and no child gets
it be done if no child gets two gifts.
10. A message consists of all the 12 symbols S1,..., S12 (in any order) plus 50
blanks distributed between the symbols (not before and not after, just between) so
that there are at least 3 blanks between successive symbols. How many messages are
there.
page 6 of Section 1.5
11. A child has a repertoire of 4 piano pieces and must practice 10 pieces at each
session.
(a) How many different sessions are there.
(b) How many different sessions are there if she has to play each piece at least
twice.
(c) Write out all the possibilities in (b) to confirm your answer.
(d) How many sessions are there if she has to play P3 four times (exactly).
(e) How many sessions are there if she can play P2 at most 3 times.
12. Toss 12 identical balls into boxes B1,..., B5.
(a) In how many ways can it be done so that no box is empty.
(b) In how many ways can it be done so that B2 gets an odd number of balls.
(c) Suppose you want to count the number of ways it can be done so that 3 boxes
get all the balls; i.e., there are (exactly) 2 empties.
First explain what's wrong with this attempt.
Step 1 Pick 3 of the 5 boxes to get the balls
Step 2 Toss the 12 balls into those 3 boxes.
5 12+3-1
Answer is (3)( 12 ). WRONG
Then get a right answer.
13. A 5—sided die has sides named A, B, C, D, E. Toss it 100 times.
For instance some possible outcomes are
95 A's and 5 C's
1 A, 1 B, 98 D's
20 of each
etc.
How many of these outcomes have between 10 and 30 A's.
Do it in a way that doesn't involve a long sum.
14. A
In
(a)
(b)
(c)
(d)
store sells 31 ice cream flavors.
how many ways can you order a dozen cones if
you want all different flavors
exactly half must be chocolate
you want exactly 7 different flavors
the store has only enough strawberry for 2 cones
15. Consider non—negative integer solutions to x1 + x2 + x3 = 13.
(a) How many are there.
(b) How many have x1 ≥ 4 and x2 ≥ 2.
(c) How many have 2 ≤ x3 ≤ 5.
(d) How many have x1 ≥ 4, x2 ≥ 2 and 2 ≤ x3 ≤ 5.
Suggestion. Take care of x1≥ 4, x2 ≥ 2, x3 ≥ 2 and then worry about x3 ≤ 5.
page 1 of Section 1.6
SECTION 1.6
ORS
OR versus XOR
A OR B means A or B or both, called an inclusive or.
Similarly, A OR B OR C means one or more of A,B,C (i.e., exactly one of A,B,C or
any two of A,B,C or all three of A,B,C).
On the other hand, A XOR B means A or B but not both, an exclusive or.
In these notes, "or" will always mean the inclusive OR unless specified otherwise.
In the real world you'll have to decide for yourself which kind is intended. If a
lottery announces that any number containing a 6 or a 7 wins then you win with a 6
or 7 or both, i.e., 6 OR 7 wins (inclusive or). But if you order a coke or a 7-up
you really mean a coke or a 7-up but not both , i.e., coke XOR 7-up.
OR rule (principle of inclusion and exclusion
Let N(A) stand for the number of ways in which event A can happen.
(1)
(2)
N(A or B) = N(A) + N(B) - N(A and B)
N(A or B or C)
[ N(A & B) + N(A & C) + N(B & C)] + N(A & B & C)
= N(A) + N(B) + N(C) -
N(A or B or C or D)
=
N(A) + N(B) + N(C) + N(D)
-
(3)
+
-
[ N(A & B) + N(A & C) + N(A & D) + N(B & C) + N(B & D) + N(C & D)]
[ N(A & B & C) + N(A & B & D) + N(B & C & D) + N(A & C & D) ]
N(A & B & C & D)
etc.
why (1) works
Suppose A can occur in 6 ways (the 4 x's and 2 y's in Fig 1).
happen in 5 ways (the 2 y's and 3 z's in Fig 1). Then
And suppose B can
N(A or B) = 4 x's + 2 y's + 3 z's = 9
On the other hand
N(A) + N(B) = 4 x's + 2 y's
+
2 y's + 3 z's
= 11
This is not the same as N(A or B) because it counts the y's twice. You do want to
count them since this is an inclusive or, but we don't want to count them twice. So
to get N(A or B), start with N(A) + N(B) and then subtract the number of outcomes in
the intersection of A and B, i.e., subtract N(A & B) as in (1).
event B
event A
x
x
z
y
x
y
x
FIG 1
z
z
page 2 of Section 1.6
warning
The "or" in rule (1) is inclusive; it means A or B or both. You subtract away
N(A & B) not because we want to throw away the boths but because you don't want to
count them twice. In other words,
N(A or B) = N(A or B or both) = N(A) + N(B) - N(A & B)
why (2) works
Suppose A can occur in 7 ways, B in 9 ways and C in 9 ways as shown in Fig 2.
A
w
w w
uu
x
x
v
x
z
B
v
v
y
C
k
k
k
k
FIG 2
Then
N(A or B or C) = 3 x's + 1 y + 1 z + 2 u's + 3 w's + 3 v's + 4 k's = 17
But N(A) + N(B) + N(C) isn't 17 because it counts the y, u's and v's twice each and it
counts z three times.
Try again with
N(A)
x, u, y, z
+
N(B)
u, w, v, z
+
N(C)
y, v, k, z
-
[ N(A & B)
+
N(A & C)
u, z
y, z
+
N(B & C)
]
v, z
Now the u's, v's, and y will be counted once each, not twice, but z isn't counted at
all.
So formula (2) adds N(A & B & C) back in to include z again.
example 1
Find the number of bridge hands with 4 aces or 4 kings.
solution
By the OR rule,
N(4 aces or 4 kings) = N(4 aces) + N(4 kings) - N(4 aces and 4 kings).
When you count the number of ways of getting 4 aces don't think about kings at all
(the hand may or may not include 4 kings ———— you don't care). The other 9 cards can
48
be picked from the 48 non—aces so there are ( 9 ) hand with 4 aces.
48
Similarly there are ( 9 ) hands with 4 kings.
For 4K & 4A pick the other 5 cards from the 44 remaining cards.
44
Can be done in ( 5 ) ways.
48
48
44
So N(4 aces or 4 kings) = ( 9 ) + ( 9 ) - ( 5 ).
page 3 of Section 1.6
mutually exclusive (disjoint) events
Suppose A, B, C, D are mutually exclusive meaning that no two can happen
simultaneously (i.e., A, B, C, D have no outcomes in common). Then all the "and"
terms in (1), (2), (3) drop out and you get
(1')
(2')
(3')
N(A or B) = N(A) + N(B)
N(A or B or C) = N(A) + N(B) + N(C)
N(A1 or ... or An) = N(A1) + ... + N(An)
example 2
Count poker hands containing all spades or all hearts.
solution
The events "all spades" and "all hearts" are mutually exclusive since they can't
happen simultaneously. So by (1'),
13
13
N(all spades or all hearts) = N(all spades) + N(all hearts) = ( 5 ) + ( 5 )
warning
N(A or B) is not N(A) + N(B) unless A and B are mutually exclusive. If they aren't,
don't forget to subtract N(A & B).
PROBLEMS FOR SECTION 1.6
1. How many poker hands have 2 aces or 3 kings.
2. How many poker hands have the ace of spades or the king of spades.
3. How many 7—digit strings have two 3's or two 6's.
4. Suppose you're computing N(A1 or A2 or ... or A8).
(a) Eventually you have to add in 2—at—a—time terms like N(A1 & A5), N(A3 & A5) etc.
How many of these terms are there.
(b) Eventually you have to add in 3—at—a—time terms like N(A1 & A4 & A7 ),
N(A3 & A7 & A8) etc. How many of these terms are there.
5.
How many poker hands have (a) 2 aces or 2 kings
(b) 3 aces or 3 kings
6. How many poker hands have no spades or no hearts.
7. Toss a die 7 times. Order doesn't count so that one outcome for instance is
1 two, 4 fives, 2 sixes.
(a) How many outcomes are there.
(b) How many outcomes have 1 one or 2 twos or 3 threes.
8. A group consists of 6 children, 7 teenagers, 8 adults. How many committees of
size 3 contain only one age group.
9. How many poker hands contain the Jack of Spades XOR the Queen of Spades (i.e.,
Jack or Queen but not both).
page 1 of Section 1.7
SECTION 1.7 AT LEASTS
at least 4 chocolates in a paper bag (i.e., at leasts for committees with repeated members allowed)
(i.e., at leasts for indistinguishable balls into distinguishable boxes) (Section 1.5)
A store sells 5 ice cream flavors. Here's how to find the number of ways to buy 12
cones so as to get at least one chocolate.
Include one chocolate and then choose the rest of the committee, 11 cones, from
11+5-1
the 5 flavors (this allows more chocs). Answer is ( 11 ).
WRONG WAY to do at leasts for ordinary committees (no repeated members)
The method that just worked with the choc cones (put one choc on the committee to
be sure) does not work here.
Here's an example to show why not.
Suppose you want to count poker hands with at least one ace (all cards are
distinguishable from one another). Try the "pick one to be sure" method.
step 1 Pick one ace to be sure of getting at least one. Can be done in 4 ways.
51
step 2 Pick 4 more cards from the remaining 51. Can be done in ( 4 ) ways.
(The 51 allows more aces. If you use 50 you are finding exactly one ace)
51
"Answer" is 4( 4 ).
The answer is wrong because it counts the following as different outcomes when they
are really the same.
outcome 1 step 1 Pick the spade ace as the sure ace.
step 2 Pick the ace, king, queen, jack of clubs.
outcome 2 step 1
step 2
Pick the club ace as the sure ace.
Pick the spade ace and the king, queen, jack of clubs.
So this attempt double counts (i.e., counts some outcomes more than once).
Some RIGHT WAYS to do at leasts for ordinary committees
Here are some correct methods for finding N(at least one ace).
method 1
52
48
N(at least one ace) = total - N(no aces) = ( 5 ) - ( 5 )
method 2
N(at least one ace) = N(1A or 2A or 3A or 4A)
The events 1A (meaning exactly one ace), 2A, 3A, 4A are mutually exclusive so you
can use the abbreviated OR rule.
48
4 48
4 48
N(at least one ace) = 1A + 2A + 3A + 4A = 4( 4 )+ (2)( 3 ) + (3)( 2 ) + 48
method 3
N(at least one ace) = N(AS or AH or AC or AD)
=
[N(AS) + N(AH) + N(AC) + N(AD)] - [N(AH & AC) + other 2—at—a—time terms ]
+ [N(AC & AH & AD) + other 3—at—a—time terms] - N(AS & AH & AC & AD)
51
The first bracket contains 4 terms all having the value ( 4 ).
page 2 of Section 1.7
4
50
The second bracket contains (2) terms each of which has value ( 3 ).
4
49
The third bracket contains (3) terms each of which has value ( 2 ).
51
4 50
4 49
So N(at least one ace) = 4( 4 ) - (2)( 3 ) + (3)( 2 ) - 48
In this example, method 1 was best but you'll see examples favoring each of the other
methods (cf. problem 5)
footnote
The "pick one to be sure" method that works for committees with repetition
allowed does not work for ordinary committees. But methods 1 and 2 that
worked for the ordinary committees will also work for committees with
repetition.
example 1
In how many ways can 10 sandwiches be given to 4 people so that Mary gets at least 3
sandwiches if
(a) the sandwiches are all tuna (indistinguishable)
(b) the sandwiches are tuna, ham, jelly,... (all different from one another)
solution (a) This is tossing 10 indistinguishable balls into 4 distinguishable
boxes (same as committees with repetition allowed).
Give Mary 3 tunas. Then toss the remaining 7 tunas into the 4 distinguishable
7+4-1
people. Answer is ( 7 ).
(b) total - N(Mary gets none or one or two)
= total -
[N(Mary gets none) + N(Mary gets 1) + N(Mary gets 2)]
To find the total, think of each sandwich as a slot which can be filled in 4 ways.
To find N(Mary gets none), fill each sandwich slot in 3 ways.
For N(Mary gets 1), pick a sandwich for Mary (can be done in 10 ways) and then fill
each of the remaining 9 sandwich slots in 3 ways (can be done in 39 ways).
10
For N(Mary gets 2), pick 2 sandwiches for Mary (can be done in (2 ) ways and then
fill each of the remaining sandwich slots in 3 ways (can be done in 38 ways).
10
Answer is 410 310 + 10…39 + ( 2 )…38 .
example 2
[
]
How many 7—digit strings have at least five 3's (e.g., 3376333, 3133333).
solution N(at least five 3's) = N(five 3's) + N(six 3's) + N(seven 3's)
To find N(five 3's) pick five places for the 3's and fill the other 2 places with
non—3's.
To find N(six 3's) pick six places for the 3's and fill the one remaining place with
a non—3. So
7
7
N(at least five 3's) = (5)92 + (6)9 + 1
wrong way to do example 2
If you pick 5 places in the string for 3's (to be sure) and then fill the other
7
places with any of 10 digits you get "answer" (5) 102 and it's WRONG.
It's wrong because it counts the following as different outcomes when they are
really the same (they are both the string 3333339):
outcome 1 step 1 Pick positions 1-5 for the sure 3's
step 2 Fill position 6 with a 3 and position 7 with a 9.
outcome 1
step 1 Pick positions 1-4, 6 for the sure 3's
step 2 Fill position 5 with a 3 and position 7 with a 9
page 3 of Section 1.7
Except for committees with repeated members (i.e., tossing indistinguishable
balls into distinguishable boxes) you can't do "at least n of them" by starting
with n "sure" ones and then picking the rest.
at mosts
Here's how to find the number of bridge hands with at most 10 spades.
N(at most 10 spades = total - N(11 spades or 12 spades or 13 spades)
= total - N(11 spades) - N(12 spades) - N(13 spades)
52
13 39
13
= (13) - (11)( 2 ) - (12)39 - 1
exactlies combined with at leasts
I'll find the number of poker hands with (exactly) 2 spades and at least 1 heart.
method 1 Within the 2—spade world, some hands have at least one heart and the rest
have no hearts.
The number of poker hands with 2 spades and at least 1 heart is region II in Fig 1.
You can find it by taking the entire 2—Spade region and subtracting region I. So
N(2S and at least 1H) = N(2S) - N(2S and no H)
13 39 pick 2 spades
13 26 pick 2 spades
= ( 2 )( 3 ) pick 3 others - ( 2 )( 3 ) pick 3 non—hearts
warning
N(2 spades at at least 1 H) is not N(2 spades) - N(no H).
It is N(2 spades - N(2 spades and no H)
2 Spades
no H
region I
at least 1 H
region II
FIG 1
method 2
N(2S and at least 1H) = N(2S & 1H) + N(2S & 2H) + N(2S & 3H)
13
26
13 13
13 13
= ( 2 )…13…( 2 ) + ( 2 )( 2 )…26 + ( 2 )( 3 )
at least one of each
Choose committees of 6 from a population of 10 Americans, 7 Italians, 5 Germans.
(Remember that people are always distinguishable, i.e., the Americans are A1, ...A10
etc.)
N(no European nationality left out)
= N(at least one of each European nationality)
=
N(at least one I and at least one G)
= total - N(no I or no G)
= total - [ N(no I) + N(no G) - N(no I & no G) ]
22
= (6) -
[ (156) + (176) - (106) ]
N(no nationality left out)
= N(at least one of each nationality)
= N(atg least one A and at least one I and at least one G)
= total - N(no A or no I or no G)
page 4 of Section 1.7


= total - 


22
= (6) -








N(no A) + N(no I) + N(no G)
-
[N(no A & no I) + N(no A & no G) + N(no I & no G)]
+ N(no A & no G & no I)
12
15
17
(6 ) + (6 ) + (6 ) -
(
7
10
0 + (6) + ( 6 )
)
+ 0


warning
1. Don't try to do "at least one of each nationality" by picking a person from
each nationality to be sure. That will double count.
2. The opposite of "at least one of each European nationality" is not
"no Europeans"; i.e., the opposite is not "no I and no G". The correct opposite is
"no I OR no G".
some opposite (complementary) events
event
opposite
A or B
not A and not B
A and B
not A or not B
at least one King
no Kings
at least one King and at least one Queen
no Kings or no Queens
at least one King or at least one Queen
no Kings and no Queens
at least one of each suit
no S or no H or no C or no D
all reds in poker
at least one black
at most 3 Blues and at most 4 Greens
at least 4 B or at least 5G
warning
The opposite of "at least one K and at least one Q" is not "no K and no Q".
The correct opposite is "no K or no Q".
example 3 (tricky)
A box contains
100 Reds
100 Whites
100 Blacks
100 Greens
100 Yellows
R1,...,
W1,...,
B1,...,
G1,...,
Y1,...,
R100
W100
B100
G100
Y100 .
Draw 30 without replacement.
I'll find the number of samples containing (exactly) 3 colors.
wrong way
step 1
5
Pick which 3 colors to have. Can be done in (3) ways.
Say you pick R, W, B.
page 5 of Section 1.7
step 2
Pick 30 from the
300
Can be done in ( 30 )
5
300
"Answer" is (3) ( 30 )
300 R, W, B
WRONG
It's wrong because it allows fewer than 3 colors. Some of the outcomes counted are
(1)
(2)
30 Reds
10 R, 20 B
(just one color)
(just two colors)
right way
5
step 1 (same as above) Pick which 3 colors to have. Can be done in (3) ways.
Say you pick R, W, B.
step 2 Pick 30 from the 300 R, W, B so as to get at least one of each.
Use total - opp.
300
Total is ( 30 )
Opp = N(no R or no W or no B )
= N(no R) + N(no W) + N(no B)
+
=
(there are three 1—at—a—time terms)
[N(no R & no B) + other 2—at—a—time terms]
200
3 100
3( 30 ) - (2)( 30 )
5
Final answer is (3)
3
(there are (2) 2—at—a—time terms
200
3 100
[ (300
30 ) - 3( 30 ) + (2)( 30 ) ]
PROBLEMS FOR SECTION 1.7
1. How many poker hands have at least (a) 1 spade (b) 2 spades (c) 4 spades
2. How many bridge hands have at most 2 spade.
3. A hundred people including the Smith family (John, Mary, Bill, Henry) buy a
lottery ticket apiece. Three winning tickets will be drawn without replacement.
The Smith family will be happy if someone in their family wins. Find the number of
ways in which the family can end up happy. (For practice, see if you can find three
methods.)
4. Is this a correct way to count the number of 6—letter words containing two or
more Z's.
Pick 2 spots for the Z's.
Fill each of the remaining 4 spots with any of 26 letters (i.e., allow more Z's).
6
Answer is (2)…264.
5. (a) How many bridge hands have a void, i.e., are missing at least one suit.
(b) How many bridge hands have at least one royal flush (AKQJ 10 in same suit).
page 6 of Section 1.7
6. Pick 11 letters from the alphabet. The order of the draw doesn't matter. How many
possibilities have at most 3 vowels if the drawing is
(a) without replacement
(b) with replacement
Note. A committee with 5A and 6Z is considered to have 5 vowels.
A committee with 2A, 3E and 5Z has 5 vowels.
7. In how many ways can 10 cookies be given to 4 people so that no person gets left
out if
(a) the cookies are all oatmeal
(b) the cookies are all different
8. (a) Look at strings of length 10 using the letters a, b, c. How many contain
(i) at least one b
(ii) at least one of each letter
(b) Repeat part (a) but with committees of size 10 (necessarily with repeated
members) instead of strings.
9. There are 50 states and 2 senators from each state. How many committees of 15
senators can be formed containing at least one from each of Hawaii, Massachusetts
and Pennsylvania.
10. How many permutations of the 26 letters of the alphabet contain neither cat nor
dog.
11. How many poker hands contain 4 pictures including at least one ace.
12.
(a)
(b)
(c)
(d)
(e)
How many 6—letter words have
A and B appearing once each
A and B appearing at least once each
at least one from the list A, B; i.e., at least one A or at least one B
at least one A and exactly one B
two A's and at least two B's
13. (the game of rencontre———the matching game)
Look at all the ways in which seven husbands H1,..., H7 and their wives W1,..., W7
can be matched up to form seven coed couples.
For example, one match is H1W3, H2W1, H3W7, H4W4, H5W5, H6W6, H7W2
(a) Find the number of matches in which H3 is paired with his own wife.
(b) Find the number of matches in which H2 and H5 are paired with their own wives.
(c) Find the number of matches in which at least one husband is paired with his wife
and simplify to get a pretty answer.
Suggestion: The only feasible method is to use
N(at least one match)
= N(H1 gets his own wife or H2 gets his wife or ... or H7 gets his wife)
(d) Find the number of matches in which no husband is paired with his wife.
14. (like example 3 but this time with 100 identical red balls, 100 identical whites
etc)
A box contains
100 Reds (identical)
100 Whites
100 Blacks
100 Greens
100 Yellows
Draw 30 without replacement.
Find the number of samples containing (exactly) 3 colors.
page 1 of Section 1.8
SECTION 1.8 REVIEW PROBLEMS
1. Given a population of 20 people. In how many ways can you
(1) choose a leader, a senior assistant and a junior assistant
(2) choose a leader and two assistants
(3) line them up for a photo if the group includes a set of identical triplets
(4) choose a committee of 6 which must contain either Tom or Mary
(5) choose a committee of 6 not containing Sam
(6) give out 5 different books if a person is allowed to get more than one book
(7) give out 5 different books if no one can get more than one book
(8) give out 5 copies of the same book if no one can get more than one copy
(9) give out 5 copies of the same book if a person can get more than one copy
2. How many poker hands have
(a) 3 kings
(b) at least 3 kings
(c) no clubs
(d) only clubs
(e) all one suit
(f) no suit missing
3. Rewrite the product 67…66…65… ... …35…34 more compactly using factorial notation.
4. Start with 5 Men and 12 Women. How many permutations are there
(a) with the men together
(b) where the two end positions are men
(c) with no two men adjacent
5. Given 6 balls all of different colors and 4 boxes B1,..., B4.
In how many ways can the balls be distributed among the boxes
(a) if there are no restrictions
(b) so that B2 is empty
(c) so that B2 gets at least one ball
(d) so that no box is empty
6. A jury pool consists of 25 women and 17 men. Among the men, 2 are Hispanic and
among the women, 3 are Hispanic.
A jury of 12 people will be chosen from the pool.
(a) A jury is called unrepresentative if it contains no women.
It is also called unrepresentative if it contains no Hispanics.
How many unrepresentative juries are there.
(b) A jury is very unrepresentative if it contains neither women nor Hispanics.
How many very unrepresentative juries are there.
7. A fast food stand sells hamburgers, pizza, tacos, chicken. If a car with 12 people
drives up and each person orders one item, how many different orders could the
waitress get (e.g., one possibility is 11 pizzas and a taco).
8. In how many ways can the symbols A, B, C, D, 2, 3, 4, 5 be permuted if the numbers
and letters must alternate.
9. How many poker hands have
(a) the ace of spades or KQJ of spades
(b) all hearts or no hearts
page 2 of Section 1.8
10. (a) John, Mary and Tim sit in an empty row of 10 theater seats.
For instance, some possibilities are
J - - M - - - - - T
J - - T M - - - - J T M - - - - - - (a) In how many ways can it be done.
(b) In how many ways can it be done so that they sit together.
(c) In how many ways can it be done so that none of them are together.
11. In how many ways can 10 people be assigned to 3 identical jobs in a typing
pool, 4 identical file clerk jobs and 3 non—identical administrative jobs A1,A2,A3.
12. Start with 10 men, 20 women, 30 boys, 40 girls. How many committees are there
(a) of size 4 containing one of each type
(b) of size 7 with 2 men, 4 women and 1 boy
(c) of size 12 with at least 3 women
(d) of size 12 with at most 1 woman
13. Grades will be given in a class of 29 students, S1, ..., S29.
The allowable grades are A, B, C, D, F.
(a) The teacher has to hand in a list of students and their grades.
How many possible lists are there
(b) One possible distribution of grades is 28 A's and 1 B.
Another distribution is 2 A's, 1 B, 23 C's and 3 D's.
How many distributions are there.
(c) Suppose you insist on giving 5 A's, 6 B's, 7 C's, 6 D's and 5 E's. In how many ways
can the grades be assigned to the students.
14. The pizza place offers mushroom, anchovies, sausage and onion toppings. You can
be as greedy or abstemious as you like. In how many ways can you order your pizza.
15. You want to move from A to B along the streets of
the town in the diagram. You are allowed to move only
east and south and can change directions at any
intersection.
For example one possibility is to walk 1 block E,
5 blocks S and then 3 blocks E.
How many possible routes are there from A to B.
16. Compute
48
48
(a) ( 2 )/( 3 )
(b)
100
( 98 )
A•
•B
Problem 15
17. Two 5-digit strings (leading zeroes allowed) are considered equivalent if one is
a permutation of the other. For example, 12033, 01332, 20331 are equivalent.
How many "distinct" (i.e., non-equivalent) strings are there.
18. You have 26 scrabble chips, one for each letter. How many 5 letter words can be
made containing the B chip.
page 3 of Section 1.8
19. A school cafeteria has ten dishes in its repertoire: 3 beef, B1, B2, B3 and 7
vegetarian, V1,..., V7.
Each day they offer three of the dishes (e.g., B2, V4, V6; B2, V4, V7).
(a) How many days are there in a cycle, before they have to start repeating menus.
For example, B2, V6, V7 and B3, V6, V7 is not a menu—repeat but B2, V6, V7 and then
B2, V6, V7 again is a repeat.
(b) How many times does B3 appear on the menu in one cycle.
(c) Suppose you only eat beef. On how many days do you get something to eat.
(d) You like to order two lunches, one beef and one veggie. On how many days in a
cycle is this possible.
20. In how many ways can four numbers be selected from -5, -4, -3, -2, -1, 1, 2, 3, 4
so that their product is positive if the selection is
(a) without
(b) with replacement.
21. Look
(a) How
(b) How
(c) How
(d) How
(e) How
at permutations of U N U S U A L.
many are there.
many have the 3 U's together.
many have all 4 vowels together.
many have no consecutive U's.
many have no consecutive consonants.
22. A hundred messages are
some possibilities
(1) 73 go through
(2) 97 go through
etc
sent through 4 available channels. For instance, here are
C1, 27 through C2 and none through C3 and C4
C2 and 1 each through C1, C3, C4
(a) How many possibilities are there.
(b) How many possibilities are there in which messages actually go through C1, C2
and C3 but not C4.
23. A trip is oversubscribed: 15 men, 16 women and 17 teenagers sign up but only 8
can go. In how many ways can the 8 be chosen so that
(a) the group has at least one adult and the same number of men as women.
(b) the group has 2 men and at least 2 women
24. A box contains 260 letters, 10 each of A-Z. Draw 6.
For example, one possibility is 6 A's; another is 2 A's and 4 Q's.
(a) How many possibilities are there.
And does it matter whether the drawing is with or without replacement.
(b) How many of the possibilities in (a) have 3 pairs. For instance 2A, 2Q, 2Z is
one possibility. Note that 4B and 2J does not count as 3 pairs.
page 1 of Section 1.9
SECTION 1.9 BINOMIAL AND MULTINOMIAL EXPANSIONS
the binomial expansion
When (x + y)7 is multiplied out you can write the result like this:
7
7
7
7
7
7
7
7
(x + y)7 = (0)x7 + (1)x6 y + (2)x5 y2 + (3)x4 y3 + (4)x3 y4 + (5)x2 y5 + (6)xy6 + (7)y7
In general:
(1)
n
n
n
n
n
(x + y)n = (0) xn + (1) xn-1 y + (2) xn-2 y2 + ... + (n-1) xyn-1 + (n) yn
For example, when (x + y)9 is multiplied out, the coefficient of the term x3y6 is
9
9!
(6) =
6! 3!
= 84
why (1) works
Remember that when you expand something like
(a + b + c)(d + e)(f + g)
each term in the answer comes from multiplying together one term from each of the
parentheses.
For instance one term in the expansion is adf (take a from the 1st paren, d from
the 2nd, f from the 3rd).
Another term is adg (take a from the 1st paren, d from the 2nd, g from the 3rd).
A non—term is abd since a and b come from the same paren.
Now look at
(x + y)7 = (x+y)(x+y)(x+y)(x+y)(x+y)(x+y)(x+y)
7
I'll show that there's a term x3 y4 in the expansion and its coeff is (4).
One of the terms in the product is x x x y y y y, i.e.,
x
x
x
y
y
y
y
from
from
from
from
from
from
from
first paren
second paren
third paren
fourth paren
fifth paren
sixth paren
seventh paren.
Another is x y x y y y x, i.e.,
x
y
x
y
y
y
x
from
from
from
from
from
from
from
first paren
second paren
third paren
fourth paren
fifth paren
sixth paren
seventh paren.
Each of these is x3y4 and there are as many of them as there are ways of permuting 3
7!
x's and 4 y's, namely
.
3! 4!
7!
7
So there is an x3 y4 term with coeff
, or equivalently (4).
3! 4!
page 2 of Section 1.9
Pascal's triangle and Pascal's identity
Fig 1 shows the coeffs in the expansion of (x + y)n lined up in rows to form
Pascal's triangle.
Each line of coeffs can be gotten from the preceding line with the indicated
addition process
Fig 2 shows the same triangle in combinatorial notation.
1
1
add
1
1
4
5
2
3
6
add
10
4
(0)
5
(0)
3
(0)
add
4
(1)
5
(1)
add
4
10
FIG
2
(0)
3
1
3
(1)
add
1
add
←−− coeffs for (x+y)2
←−− coeffs for (x+y)3
←−− coeffs for (x+y)4
1
5
1
←−− coeffs for (x+y)5
1
2
(1)
4
(2)
3
(2)
add
2
(2)
4
(3)
5
5
(2)
(3)
FIG 2
3
(3)
add
5
(4)
4
(4)
5
(5)
In the notation of Fig 2, the addition rule from Fig 1 looks like this:
4
4
5
4
4
5
(0) + (1) = (1) ,
(1) + (2) = (2)
etc.
In general:
(2)
n
(k-1)
n
n+1
+ (k) = ( k )
(Pascal's identity)
why (2) works
Think of committees of size k chosen from n+1 people P1,..., Pn+1. Then
total committees = committees with P1 + committees without P1
n+1
The total number of committees is ( k ).
n
n
There are (k-1) committees containing P1 and (k) committees not containing P1 so
n
n
n+1
(k-1) + (k) = ( k )
QED
example 1
The next line in the triangle in Fig 1 is
1
6
15
20
15
6
1
so
(x + y)6 = x6 + 6x5 y + 15x4 y2 + 20x3 y3 + 15x2 y4 + 6xy5 + y6
example 2
57
57
The coeff of x26 y31 in the expansion of (x + y)57 is (31) or equivalently (26)
page 3 of Section 1.9
the multinomial expansion
Here's an illustration of the general idea.
If
(a + b + c + d)17
is multiplied out, there are terms of the form
ab5 cd10,
b16 d,
a9 b2 c3 d3
etc.
(In each term, the exponents add up to 17.)
The coefficient of a8 b2 c3 d4 in the expansion of (a + b + c + d )17
is
17!
,
8! 2! 3! 4!
(3)
called a multinomial coefficient.
why (3) works
When (a + b + c + d)17 is multiplied out, each term is created by taking one
letter from each of the 17 parentheses.
One of the terms in the product is
i.e.,
a a a a a a a a b b c c c d d d d,
a's
b's
c's
d's
Another is
from
from
from
from
first eight parens
next two parens
next three parens
next four parens
a b a a a a a a a b c c c d d d d.
Each of these is a8 b2 c3 d4 and there are as many of them as there are ways of
permuting 8 a's, 2 b's, 3 c's, 4 d's. So there is an a8 b2 c3 d4 term with coeff
17!
((1) inSection 1.4)
8! 2! 3! 4!
example 3
In the expansion of (x + y + z)15
15!
the coeff of x4 y5 z6 is
4! 5! 6!
15!
the coeff of x5 z10 is
5! 0! 10!
etc.
(you can leave out the 0! since it's 1)
PROBLEMS FOR SECTION 1.9
1.
Find the coeff of x43 y6 in the expansion of (x + y)49.
2. Expand (x + y)7 using Pascal's triangle and check some of the coeffs with (1).
3. Find the coeff of (a) a2bc4 d6 (b) abcd10 in the expansion of (a + b + c + d)13.
page 4 of Section 1.9
13
5 8
4. Find the coeff of x3 x4 in the expansion of (x1 + x2 + x3 + x4) .
5. How many terms are there in the expansion of (x + y + z + w)17 (after you combine
like terms).
Suggestion: A typical term is of the form xÍ yÍ zÍ wÍ
is 17.
where the sum of the boxes
6. The last problem in Section 1.6 was solved twice. One method gave the answer
50
50
51
51
50
( 4 ) + ( 4 ) and a second method gave the answer ( 4 ) + ( 4 ) - 2( 3 ).
Use Pascal to reconcile the two answers without resorting to any numerical
computation.
page 1 of Section 1.10
SECTION 1.10 PARTITIONS
dividing people into distinguishable groups
Here's an example to illustrate the general idea.
Suppose a group of 30 people is to be divided (partitioned) into a
4—person school board
4—person park board
4—person sewer board
5—person street board
5—person tree board
7—person housing board
1—person transportation board
To find the number of possibilities, use each board as a slot:
(1)
30 26 22 18 13 8
Answer = ( 4 )( 4 )( 4 )( 5 )( 5 )(7)
footnote
The expression in (1) is
30!
4! 26!
26!
4! 22!
22!
4! 18!
18!
5! 13!
13!
5! 8!
8!
7! 1!
which cancels down to the more compact version
(2)
(4!)
3
30!
(5!)
2
7! 1!
In this section I mostly stick with the longer form.
more footnote
Here's another method which jumps right to the compact form in (2).
Print up the following 30 labels
4 school board labels
4 park board labels
4 sewer board labels
5 street board labels
5 tree board labels
7 housing board labels
1 transportation board label
30!
ways by (1) in ±1.4
4! 4! 4! 5! 5! 7! 1!
Now that the labels are permuted, pin them respectively on the people
P1,..., P30. (one way to do it).
So the final answer is the one in (2).
Permute the labels. Can be done in
dividing people into indistinguishable (nameless) groups
Take the same 30 people again but this time find the number of ways to divide
(partition) them into seven groups (cells) of sizes 4,4,4,5,5,7,1.
For example, the list of outcomes looks like this:
outcome 1
P1, P2, P3, P4
P5, P6, P7, P8
P9, P10, P11, P30
P12-P16
P17-P21
P22-P28
P29
page 2 of Section 1.10
outcome 2
etc.
P1, P2, P3, P29
P5, P6, P7, P8
P9, P10, P11, P30
P12-P16
P17-P21
P22-P28
P4
To count the number of outcomes here, you can't use slots because there is no such
thing as the first group of size 4, the second group of size 4, the third group of size
4 and similarly the two groups of size 5 aren't distinguished from one another. So
this problem is different from the one above. Here's how to get an answer using the
connection between this problem and the previous one.
Each possibility in this problem gives rise to 3! 2! possibilities in the preceding
example because once you have divided the 30 people into groups of sizes 4,4,4,5,5,7,1
you can give the three groups of size 4 the labels school, park, sewer in 3! ways;
and you can give the two groups of size 5 the labels street, tree in 2! ways. For
example, item 1 above gives rise to the following possibilities in the preceding
example:
outcome 1a
P1, P2, P3, P4
P5, P6, P7, P8
P9, P10, P11, P30
P12-P16
P17-P21
P22-P28
P29
school
park
sewer
street
tree
housing
trans
outcome 1b
P1, P2, P3, P4
P5, P6, P7, P8
P9, P10, P11, P30
P12-P16
P17-P21
P22-P28
P29
park
school
sewer
street
tree
housing
trans
etc
So
answer to this problem ≈ 3! 2! = answer to the preceding problem
answer to this problem
=
answer to preceding problem
3! 2!
The number of ways to divide 30 people into groups of sizes 4,4,4,5,5,7,1 is
30 26 22 18 13 8
( 4 )( 4 )( 4 )( 5 )( 5 )(7)
3! 2!
<--- extra factors
page 3 of Section 1.10
example 1
Start with 12 people.
In how many ways can they be divided into four trios.
solution
I'm going to do another problem first: Divide the 12 people into trios named T1, T2,
T3, T4 (say to cook, serve, wash, dry). For this new problem you can use slots:
12 9 6
answer to new problem = (3 )(3)(3)
In the original problem, the trios do not have names.
Answer to original problem ≈ 4! ways to name the trios
= answer to new problem.
answer to new problem
4!
12 9 6
(3 )(3)(3)
=
<--- extra factor
4!
So the answer to the old problem =
clarification
12 9 6
The answer to example 1 is not (3 )(3)(3). This "answer" double counts (by a
factor of 4!). For example, it counts the following outcomes as different when they
are really the same.
outcome 1
outcome 2
P1,P2,P3;
P4,P5,P6;
P4,P5,P6;
P1,P2,P3;
P7,P8,P9;
P7,P8,P9;
P10,P11,P12
P10,P11,P12
example 2
(a) In how many ways can 76 people be divided into 9 cells of
sizes 7, 7, 13, 13, 13, 13, 6, 3, 1.
(b) In how many ways can 76 people be divided among 9 hotels H1,..., H8 if
H1 and H2 have 7 vacancies each
H3, H4 H5 and H9 have 13 vacancies each
H6 has 6 vacancies
H7 has 3 vacancies
H8 has 1 vacancy
solution
(a) The two groups of size 7 are not distinguishable from one another and neither
are the four groups of size 13 so if you use 9 slots you'll have to divide by the
extra factors 2!4! to compensate. The answer is
76 69 62 49 36 23 10 4
( 7 )( 7 )(13)(13)(13)(13)( 6 )(3)
2! 4!
(b) Use the hotels as the slots:
76 69 62 49 36 23 10 4
( 7 )( 7 )(13)(13)(13)(13)(6 )(3)
footnote (another point of view)
The problem in (b) can be thought of as tossing 76 distinguishable balls into
8 distinguishable boxes B1,..., B9 so that B1 and B2 get 7 balls each, B3, B4,
B5, B9 get 13 balls each, B6 gets 6 balls, B7 gets 3 balls and B8 gets 1 ball.
The problem in part (a) is to toss 76 distinguishable balls into 9
indistinguishable boxes so that 2 of the boxes get 7 balls each, 4 boxes get 13
balls each, one box gets 6 balls, one box gets 3 balls and one box gets 1 ball.
page 4 of Section 1.10
example 3 (when the two types coincide)
(a) In how many ways can 12 people be divided into groups of sizes 3, 4, 5.
(b) In how many ways can 12 people be divided into a 3—person school board,
a 4—person park board and a 5—person sewer board.
solution
These are the same problem. In part (a), the groups are named "group of 3", "group
of 4" and "group of 5". In each case the answer is
12 9
( 3 )(4)
For part (b) the slots are school, park, sewer.
For part (a) the slots are "group of 3", "group of 4", "group of 5".
example 4
In how many ways can you divide 30 people into two trios, five quartets and two
duos named D1 and D2.
solution
First do this problem. Divide 30 people into two trios T1, T2, five quartets
Q1, ... Q5 and the duos D1, D2. Use the T's, Q's and D's as slots. Can be done in
30 27 24 20 16 12 8 4
(3 )(3 )(4 )(4 )(4 )(4 )(4)(2)
In the original problem the trios were indistinguishable and the quartets were
indistinguishable. Each outcome in the original problem gives rise to 2!5! outcomes
in the new problem (the trios can be named in 2! ways, the quartets in 5! ways). So
answer to original problem ≈ 2! 5! = answer to new problem
answer to original problem =
30 27 24 20 16 12 8 4
(3 )(3 )(4 )(4 )(4 )(4 )(4)(2)
2!5!
PROBLEMS FOR SECTION 1.10
1. Four people will divide up 16 books B1,..., B16 so that Tom and Dick get 6 apiece,
Harry gets 1 and Mary gets 3. In how many ways can it be done.
2. (a) Twelve people at a party divide into four conversational groups of 3 each. In
how many ways can it be done.
(b) Twelve office workers arrange their vacations so that 3 go in each of the months
of June, July, Aug, Sept. How many vacation schedules are there.
3. There are 100 children in the fifth grade.
(a) In how many ways can they be split into 4 sections of
(b) In how many ways can 25 be assigned to Ms. X as their
25 to Z and 25 to W.
(c) In how many ways can they be split into 4 sections of
Mary are in different sections
(d) In how many ways can they be split into 4 sections of
Mary are in the same section.
25 each.
teacher, 25 to Mr. Y,
25 each so that John and
25 each so that John and
4. Twenty—one people show up for a tennis tournament. In how many ways can the 10
matches and one bye be arranged. Cancel to get a short answer.
page 5 of Section 1.10
5. In how many ways can 18 players be divided into
(a) two teams of 9 each
(b) a home team of size 9 and an away team of size 9
6. In how many ways can 170 people be divided into
2 groups of size 5
3 groups of size 20
4 groups of size 10
a red team of size 30
a blue team of size 30
Cancel to get a compact answer.
7. 350 people register for a course.
(a) In how many ways can they be split into sections of sizes 50, 100, 200.
(b) In how many ways can they be split into 50 for Section A, 100 for Section B and
200 for Section C.
(c) In how many ways can they be split into sections of sizes 50, 100, 200 so that
John and Mary are in the same section.
8. A company makes 20 different cereals. They decide to market them in a 10—pack and
two 5—packs. They have to decide how to divide up the cereals among the packs. For
instance should Tweeties go in the 10—pack and if so with what other 9 cereals or
should Tweeties go in a 5—pack and if so with what 4 other cereals. How many
possibilities are there.
9. Here are two problems with proposed solutions. Are the solutions correct. If a
solution is not correct, explain why not and fix it.
(a) To count the ways to divide 100 people into two groups of size 50:
100
Pick 50 of the 100 people. Can be done in ( 50 ) ways.
This automatically leaves a second group of 50.
100
Answer is ( 50 ).
(b) To counts the ways to divide 100 people into groups of size 25 and 75:
100
Pick 25 of the 100 people. Can be done in ( 25 ) ways.
This automatically leaves a group of size 75.
100
Answer is ( 25 ).
page 1 of review problems for Chapter 1
REVIEW PROBLEMS FOR CHAPTER 1
r-1
r-1
1. Show that (r-n) = (n-1)
2. Consider strings of digits of length 7 (e.g., 0000000, 2345678).
(a) How many are there.
(b) How many contain no 5's.
(c) How many have at least one 2.
(d) How many have an least one 2 or 3.
(e) How many have at least one 2 and at least one 3.
(f) how many have one 3 and two 4's.
(g) how many have one 3 and at least two 4's.
3. From a
and 9 for
(a) the
(b) the
pool of 50 people, choose 5 for a basketball game, 4 for a hockey game
a baseball game. In how many ways can it be done if
3 games are played simultaneously
games are played on different days
4. Consider 6—letter words using only the three letters P,Q,R.
(a) How many have 4 of one kind, one of a second kind and one of a third kind
(e.g., RRRRPQ, PPQPRP).
(b) How many have 3 of a kind and a pair (e.g., PPPRRQ, QRQRQP).
5. There are 6! ways to arrange A1,..., A6 on a line. In how many ways can they be
arranged on a circle.
Note that circles I and II below are different but I and III are the same
(spinning doesn't change the circle).
A1
A1
A6
A5
A1
I
A5
A2
A3
A4
III
A6
A4
A2
A3
A6
A2
II
A4
A5
A3
6. (a) Find the coeff of x9 y11 in the expansion of (x + y)20.
(b) Find the coeff of a2 b3 c4 in the expansion of (a + 5b + c)9.
7. You want to count the ways to divide 10 people into 5 pairs.
(a) Explain why these proposed solutions are wrong.
10
45
(i) There are (2 ) = 45 pairs. Pick 5 of them. Answer is (5 ) WRONG
(ii) Pick 5 people. Then match these 5 with the remaining 5.
10
Answer is (5 ) 5! WRONG
10 8 6 4 2
(iii) Keep picking twosomes: (2 )(2)(2)(2)(2)
WRONG
(b) Find the right answer.
8. Four companies C1,..., C4 bid for eleven different government grants. In how many
ways can the grants be awarded if C2 must get between 2 and 5 grants.
9. How many permutations of the 26 letters of the alphabet have exactly three
letters between A and B.
page 2 of review problems for Chapter 1
n
n
n
n
that (0) + (1) + (2) + ... + (n) = 2n
(a) by expanding (1 + 1)n
(b) with a combinatorial proof by making up a counting problem and solving it two
different ways.
10. Show
11. You have 10 hours to study for History, Math, Spanish. For example two
possibilities are
9 hours on H, 1 hour on S
3 hours on H, 3 hours on M, 4 hours on S
How many possibilities are there.
12.
You
one
two
one
In how
are required to take
course from A1, A2, A3
courses from B1, B2, B3, B4, B5
course from C2, C2, C3, C4
many ways can you fill the requirements.
13. In how many ways can 20 offices be linked by intercoms if there is equipment for
three 2—office hookups, one 4—office hookup and two 5—offices hookups.
n
n
n
14. Use Pascal's identity to combine (k) + 2(k-1) + (k-2) into a single binomial
coefficient.
15. You're spending 7 days at a resort and there are four activities A, B, C, D
available.
(a) Suppose you want to do one activity each day so as to eventually try each one.
For example, one schedule might be
Monday
B
Tues
B
Wed
A
Thurs
D
Fri
C
Sat
C
Sun
B
How many of these schedules are there.
(b) Suppose you are going to rest for four days and do a different activity on each
of the other 3 days. For example, one schedule might be
Mon
rest
Tues
rest
Wed
B
Thurs
rest
Fri
A
Sat
rest
Sun
C
How many of these schedules are there.
2n+3
n+2
16. Use algebra to simplify (2n+1) - 3( n ).
17. A store has 7 A's, 4 B's and 2 C's in stock. You come in to buy eight items. But
if you ordered 1 A, 5 B's and 2 C's the store couldn't fill your order because it
doesn't have enough B's. How many unfillable orders are there.
18.
How many strings of 0's and 1's of length 7 have three 1's.
page 3 of review problems for Chapter 1
19. Five people P1,..., P5 sit down in a 12 chair row. For example here's one
possibility:
P5
P1
P2
P4
P3
Find
(a)
(b)
(c)
(d)
into
the number of possibilities using the following methods.
Fill slots.
Permute 5 people and 7 empty chairs.
Pick chairs for the people and then fill them.
(excruciatingly clever) Line up the people and then toss 7 identical chairs
the 6 in—betweens and ends.
20. The guidebook to Rome recommends 13 churches and 4 museums.
One possibility is that you visit C1, C5, C12, M2.
Another possibility is that you visit only C2.
How many possibilities are there.
21. How many 4 letter words have no repeats.
For example, ABAC is no good; PQBC is OK.
22. In how many ways can 10 marbles be put into 4 distinct containers if
(a) all the marbles look the same
(b) the marbles are all different colors
(c) the marbles are all the same and each box must get at least one marble
(d) the marbles are all different colors and each box must get at least one marble
23. How many permutations of the alphabet contain
(a) MOTHER but not PA.
(b) neither MOTHER nor PA
24. Out of 100 students, 20 will be picked for academic honors and 12 for athletic
honors (overlap allowed, i.e., athletic scholars are possible).
(a) In how many ways can it be done.
(b) How many of the possibilities from part (a) have 5 overlaps, i.e., how many of
the possibilities give 5 people both athletic and academic honors.
25. A function f(x,y) has the following 2nd order partial derivatives:
fxx
(differentiate twice w.r.t. x)
fyy
(differentiate twice w.r.t. y)
fxy
(differentiate first w.r.t. x and then w.r.t. y)
fyx
(differentiate first w.r.t y and then w.r.t. x)
Similarly, the 10th order partials of f(x,y,z,w) are fxxxyzzwwxy, fyyyyyyzzzz etc.
(a) How many 10th order partials does f(x,y,z,w) have.
(b) It's a theorem in calculus that fxy = fyx. Similarly fxyzz = fzxyz = fyzzx etc.
All that counts is how often the differentiation is done for each variable; the order
in which it's done doesn't matter.
With this in mind, how many truly different 10th order partials does f(x,y,z,w) have.
26. (a) How many 15—letter words have five 3—of—a—kinds
(e.g., AAABBBCCCQQQZZZ, ABCQZABCQZABCQZ)
(b) How many 15 card hands have five 3—of—a—kinds
(e.g., AH, AS, AC, QH, QD, QS, 3D, 3C, 3S, 9D, 9C, 9S, 7H, 7C, 7S )
Download