HW5
HW5
HW5
3/4/2015
SOLUTIONS
In-class Exercise 12. For each of the following, use some combination of the sum and product
rules to find your answer. Give an un-simplified numerical answer, and explain it, saying which
rule(s) youre using when.
(a) A particular kind of shirt comes in two different cuts - male and female, each in three color
choices and five sizes. How many different choices are made available?
Use the product rule to calculate
# shirts = (# genders )(# colors )(# sizes ) = 2 3 5.
(For each choice of cut, there are the same number of colors, and for each cut and color theres
the same number of sizes.)
(b) On a ten-question true-or-false quiz, how many different ways can a student fill out the quiz
if they definitely answer all of the questions? How many ways if they might leave questions
blank?
Use the product rule to calculate
# possible answers = (# anss to 1 )(# anss to 2 ) (# anss to 10 ).
If nothing is left blank, there are 2 possible answers to each question, giving 210 . If you can
leave an answer blank, there are 3 possible answers to each question, giving 310 .
(c) How many 3-letter words (these dont have to be real words, just strings of letters) are there?
Use the product rule to calculate
# words = (# letters )(# letters )(# letters ) = 26 26 26.
(d) How many 3-letter words are there that end in a vowel?
Use the product rule to calculate
# words ending in a vowel = (# letters )(# letters )(# vowels ) = 26 26 5.
(e) How many 3-letter words are there that have no repeated characters?
# words = (# letters )(# letters remaining )(# letters remaining after that)
= (# letters )((# letters ) 1)((# letters ) 2) = 26 25 24.
(f) How many 3-letter words are there that have the property that if they start in a vowel then
they dont end in a vowel? (Youll want to break this into disjoint cases).
Break this into two cases:
(a) Letters that start in a vowel:
If they start in a vowel, they dont end in a vowel, so there are 5 26 21 possibilities
(product rule).
(b) Letters that dont start in a vowel:
If they dont start in a vowel, there are no restrictions, so there are 21 26 26 possibilities
(product rule).
1
X)
To check your answers: (a) 30; (b) 1024; 59,049; (c) 17,576; (d) 3380; (e) 15,600; (f) 16,926; (g)
2704; (h) 2028.
In-class Exercise 13. For each of the following, use some combination of the sum, product,
inclusion-exclusion, and division rules to find your answer. Give an un-simplified numerical answer,
and explain it, saying which rule(s) youre using when.
(a) How many stings of three letters are there that satisfy the following:
(i) that contain exactly one vowel?
Product rule:
(# places to put the vowel )(# ways to pick the vowel )
(# ways to pick the two non-vowels in order ) = 3 5 212 .
possibilities.
(v) are not all the same suit? (use two of your previous answers)
(c) How many ways are there to seat 6 people at a round table with 6 chairs, if youre only paying
attention to who is sitting next to whom (accounting for right and left i.e. A cares if they
have B to their left and C to their right, but they dont care which seat they sit in)?
First, think about lining 6 people up in a row, which product rule tells us has 6 5 4
3 2 1 possibilities. But sitting them in a circle, where rotating the circle leaves the seating
arrangement unchanged, means that 6 of those arrangements will be equivalent (each rotation
to the right by one seat). So the division rule says there are (6 5 4 3 2 1)/6 possibilities
in total.
(d) How many non-negative integers less than 100 are there that are divisible by 2 and/or 3?
There are d100/2e = 50 non-negative integers less than 100 divisible by 2 and d100/3e = 34
non-negative integers less than 100 divisible by 3. However, combining these two values would
double-count non-negative integers less than 100 divisible by 2 and 3, i.e. divisible by 6, of
which there are d100/6e = 17. So inclusion-exclusion tells us there are
50 + 34 17
non-negative integers less than 100 that are divisible by 2 and/or 3.
In-class Exercise 14. Draw the tree-diagram that tells you how many ways to form the following
results, and count the possible outcomes.
(1) Strings of 1s and 0s of length-four with no three consecutive 0s.
0
(0010)
(0011)
(0100)
(0101)
(0110)
(0111)
(1001)
(1010)
(1011)
(1110)
(1100)
(1101)
1
(1111)
(2) Subsets of the set {3, 7, 9, 11, 24} whose elements sum to less than 28.
24 out
3 in
n
7i
3 in
n
7i
3 in
n
7i
3 out
3 out
3 out
3 out
3 out
3 out
3 in
3 in
3 out
ut
7o
ut
ut
7i
9o
7o
ut
9i
ut
7o
7o
3 out
ut
3o
3i
9o
ut
3 in
9i
9 out
7 out
11 o
ut
n
11 i
11 out
3 in
24 in
(A) P (n, k + 1) is the number of ways to choose k + 1 things from n in order. Since
its in order, you can choose the first k things first, and then choose the last thing
separately. After k things, there are n k to choose from.
n!
n!
(B) P (n, k + 1) = (n(k+1))!
= (nk)!/(nk)
P (n, k) (n k)
(iv) n1 = n
(A) This
number of ways to pick one thing out of n, of which there are n possibilities.
is the
n
n!
(B) 1 = (n1)!1! = n
(v) nn = 1
(A) This is the number of ways to choose everything all at once out of a group of n. There
is one way to do this pick everything.
n!
(B) nn = (nn)!n!
= 1 (since 0! = 1)
(vi) n0 = 1
(A) This is the number of ways to choose nothing from n things. There is one way to do
that
take anything.
- dont
n!
= 1 (again, since 0! = 1)
(B) n0 = (n0)!0!
n
(vii) nk = nk
(A) This is because choosing k things from n is the same as picking n k things from n
to exclude.
n
n!
n!
(B) nk = (nk)!k!
= k!(nk)!
= nk
In-class Exercise 16. For each of the following, be sure to include how the pigeonhole principle
or its generalized version apply in your justifications, or why neither of them do.
(a) The lights have gone out and youre digging through an unorganized sock drawer filled with
unmatched black socks and brown socks (otherwise roughly identical).
(i) If youre pulling them out at random, how many socks do you need to take out to ensure
you have a matching pair if there are 10 of each kind of sock? How about if there are 20
of each? 100 of each?
It doesnt matter how many socks you have to choose from as long as you have enough
to apply generalized pigeonhole principle. In any case, the colors are the boxes and the
socks youve picked are the items, and so you want to solve dn/2e 2 for the minimal n:
n = 3.
(ii) Again pulling at random, how many socks do you need to take out to ensure you have a
matching brown pair if there are 10 of each kind of sock? How about if there are 20 of
each? 100 of each?
This is not pigeonhole principle since you need brown in particular. This is asking to
guarantee that a specific box has at least 2 object. So you need to take into account that
you might pull out all of the black socks before you get a single brown sock. Therefore
you need to pick 12 if there are 10 of each kind of sock, 22 if there are 20 of each, and 102
if there are 100 of each.
(b) Explain why, out of any set of four integers, at least two have the same remainder when divided
by 3.
Here the elements are the integers and the remainders are the boxes. There are only three
possible remainders when dividing by 3 0, 1, and 2. Since youve picked 4 object,s pigeonhole
principle tells us at least two of them go in the same box, i.e. that two of them have the same
remainder.
(c) A recent estimate showed that the US and Canada together (which share the country code
+1) have approximately 134,000,000 phone lines in use. What is the minimum number of area
codes needed to make that possible?
The boxes are the area codes and the 7-digit phone numbers are the objects. You have to
ensure that there are enough of them so that no more than then number of possible 7-digit
phone numbers are forced into the same area code. Since there are 8106 possible 7-digit phone
numbers, you want to solve for the minimal k such that
(134 106 )/ke 7 106 .
This is k = 20.
(d) Let f : A B be a function between finite sets such that |A| > |B|. Explain why f cannot
possibly be injective. (Consider the sizes of the preimages {f 1 (b) | b B}.)
Here, the elements of B are the boxes and the elements of A are the objects. Pick any
function f it tells you what objects go into what boxes (an object a is in box b if a is in the
preimage of b). Since there are more objects than boxes, pigeonhole principle tells us that some
box has more than one object in it i.e. some element of b has more than one element of a in
its preimage. Therefore the function is not injective.
(e) Explain why, in any sequence of n consecutive integers, at least one of them must be divisible
by n. (Start with, say, n = 4 as an example.)
Like in part (c), the remainders are the boxes and the consecutive integers are the boxes.
Now suppose that you have n consecutive integers, none of which are divisible by 0. Note that
when you increase an integer z by 1, you increase its remainder by 1; unless z + 1 is divisible
by n, in which case you drop it to 0. Since none of the consecutive integers is divisible by n,
not only do none of them have a remainder of 0, but moving up the chain, you never drop the
remainder to 0. So the integers have distinct remainders.
However, if none of the integers are divisible by n, then were only using n 1 out of the n
boxes.So pigeonhole principle tells us that some box has at least 2 elements, i.e. there are two
of these integers that have the same remainder when divided by n. This is a contradiction.
Thus one of any n consecutive integers must be divisible by n.