iD1 i p converges iff p < a. What is the value of a? Prove it. Hint: Find a value for a you think that works,
then apply the integral bound. Homework Problems Problem 14.14. There is a bug on the edge of a 1meter rug. The bug wants to cross to the other s

depend on one another; in particular, they must all be different. However, a slightly sharper tool does
the trick. mcs 2017/4/27 14:48 page 614 #622 Chapter 15 Cardinality Rules614 Prizes for
truly exceptional Coursework Given everyones hard work on this

least quadratic, say T .n/ D .n2 /: There is a similar little omega notation for lower bounds
corresponding to little o: Definition 14.7.16. For functions f; g W R ! R with f nonnegative, define f D !.g/
to mean g D o.f /: For example, x 1:5 D !.x/ and p

hole. mcs 2017/4/27 14:48 page 631 #639 15.8. The Pigeonhole Principle 631 1st sock A f
2nd sock 3rd sock 4th sock red B green blue Figure 15.3 One possible mapping of four socks to three
colors. What pigeons have to do with selecting footwear under poor

dx : (a) Prove that the function fa.n/ WWD n a grows slowly for any a > 0. (b) Prove that the function e n
does not grow slowly. (c) Prove that if f grows slowly, then Z n 1 f .x/ dx Xn iD1 f .i / : Exam Problems
Problem 14.9. Assume n is an integer large

arrangements on the right. O2BO1K KO2BO1 O1BO2K KO1BO2 BO1O2K BO2O1K : : : BOOK OBOK KOBO :
: : (d) This is a k-to-1 mapping, young grasshopper? What is k? (e) In light of the Division Rule, how many
arrangements are there of BOOK? (f) Very good, young ma

portions of serial numbers all occur equally often, we could answer this question by computing fraction
of nondefective bills D jfserial #s with all digits differentgj jfserial numbersgj : (15.1) Lets first consider
the denominator. Here there are no rest

the same color. mcs 2017/4/27 14:48 page 665 #673 15.11. References 665 (c) Map the i.p.
fhuvi;hvwig to the triangle fhuvi;hvwi;huwig: Notice that multicolored i.p.s map to
multicolored triangles. Explain why this mapping is 2-to-1 on these multicolored o

its code. (b) Conclude there is a bijection between the n-vertex numbered trees and sequences .n 2/
integers in 1:n. State how many n-vertex numbered trees there are. Problem 15.9. Let X and Y be
finite sets. (a) How many binary relations from X to Y are

15.1 Two ways of placing a pawn (p), a knight (N), and a bishop (B) on a chessboard. The configuration
shown in (b) is invalid because the bishop and the knight are in the same row. cP is one of 8 columns rN
is one of 7 rows (any one but rP ) cN is one of

cards of the same suit. In the example, the assistant might choose the 3~ and 10~. This is always possible
because of the Pigeonhole Principlethere are five cards and 4 suits so two cards must be in the same
suit. The Assistant locates the ranks of these

n D n n D .n 1/ : mcs 2017/4/27 14:48 page 620 #628 Chapter 15 Cardinality Rules620
15.5 Counting Subsets How many k-element subsets of an n-element set are there? This question arises
all the time in various guises: In how many ways can I select 5 books

R. Namely, an element .s; fr1; r2g; .r3; r4; r5/ 2 S R2 R 3 indicates 1. the repeated suit s 2 S, 2. the set
fr1; r2g 2 R2 of ranks of the cards of suit s and 3. the ranks .r3; r4; r5/ of the remaining three cards, listed
in increasing suit order where |

subsets of A and jAi j D ki for i D 1; : : : ; m. To count the number of splits we take the same approach as
for the Subset Rule. Namely, we map any permutation a1a2 : : : an of an n-element set A into a .k1; k2; : :
: ; km/-split by letting the 1st subse

in the lower-left corner. The problem is that those are two different ways of describing the same
configuration! In fact, this arrangement is shown in Figure 15.2(a). More generally, the function f maps
exactly two sequences to every board con- figuration

clients debt after d days and find an equivalent closed form. (d) If you borrowed $10 from Sammy for a
year, how much would you owe him? Homework Problems Problem 14.4. Is a Harvard degree really
worth more than an MIT degree? Let us say that a person wit

and Magician agree on a matching containing the two bold edges in Figure 15.5. If the audience selects
the set f8~; K; Q; 9|; 6g; (15.3) then the Assistant reveals the corresponding sequence .K; 8~; 6;
Q/: (15.4) mcs 2017/4/27 14:48 page 637 #645 15.8. Th

Practice: Poker Hands 627 15.7.2 Hands with a Full House A Full House is a hand with three cards of one
rank and two cards of another rank. Here are some examples: f2; 2|; 2; J |; J g f5; 5|; 5~; 7~; 7|g
Again, we shift to a problem about sequences. There

can be formed in this way is Tnn.n 1/ D Tnn : Another way to count these edge sequences is to start
with the empty graph and build up a spanning forest of rooted trees by adding edges in sequence. When
n k edges have been added, the graph with these edges

f; g; A; |/ % .9; f~; g; 5; f~; |g; K; / & f9~; 9; 5~; 5|; Kg .5; f~; |g; 9; f~; g; K; / % The problem is
that nothing distinguishes the first pair from the second. A pair of 5s and a pair of 9s is the same as a
pair of 9s and a pair of 5s. We avoided thi

two terms, such as a C b. Now consider its fourth power .a C b/4 . By repeatedly using distributivity of
products over sums to multiply out this 4th power expression completely, we get .a C b/4 D aaaa C aaab
C aaba C aabb C abaa C abab C abba C abbb C baa

varieties are available B D all 16-bit sequences with exactly 4 ones An example of an element of set A is:
0 0 chocolate lemon-filled 0 0 0 0 0 0 sugar 0 0 glazed 0 0 plain Here, weve
depicted each donut with a 0 and left a gap between the different varie

(15.15) (Do not prove this using Fermats little Theorem. The point of this problem is to offer an
independent proof of Fermats theorem.) (c) Explain how (15.15) immediately proves Fermats Little
Theorem 9.10.8: n p1 1 .mod p/ when n is not a multiple of p

must have the same sum! Notice that this proof gives no indication which two sets of numbers have the
same sum. This frustrating variety of argument is called a nonconstructive proof. The $100 prize for two
same-sum subsets To see if it was possible to ac

some n 2 N. Prove that is an equivalence relation. 7A sequence in which all the elements of a set X
appear exactly once is called a permutation of X (see Section 15.3.3). 8This Theorem is usually stated as a
p1 1 .mod p/; for all primes p and integers a n

each of the expressions below. (a) 2x3 C .log x/x2 (b) 2x2 + .log x/x3 (c) .1:1/x (d) .0:1/x (e) .x4 C x 2 C
1/=.x3 C 1/ (f) .x4 C 5 log x/=.x4 C 1/ (g) 2 .3 log2 x 2/ Problem 14.17. Let f .n/ D n 3 . For each function
g.n/ in the table below, indicate wh

nsin.n=2/ log.n/ log.nn / n k c n logk n n Problem 14.24. Arrange the following functions in a sequence
f1, f2, . f24 so that fi D O.fiC1/. Additionally, if fi D .fiC1/, indicate that too: 1. n log n 2. 2 100n 3. n 1 4.
n 1=2 5. .log n/=n 6. n 64 7. n mcs

lined up on a shelf. The number of selections of m of the books so that selected books are separated by
at least three unselected books is the same as the number of all length k binary strings with exactly m
ones. (a) What is the value of k? (b) Describe

notation S 5 means S S S S S. mcs 2017/4/27 14:48 page 613 #621 15.3. The Generalized
Product Rule 613 Thus, the length-six passwords are in the set F S 5 , the length-seven passwords are in F
S 6 , and the length-eight passwords are in F S 7 . Since thes

roll .4; 4; 2; 2; 4; 2; 4/ 2 A maps to .2; 4/; fyellow,green,indigog/ 2 B: Now by the Bijection rule jAj D jBj,
and by the Generalized Product and Subset rules, jBj D 6 5 7 3 ! : (a) For how many rolls do exactly two
dice have the value 6 and the remainin

sizes of the various intersections. Lets suppose that there are: 4 math - EECS double majors 3 math physics double majors 11 EECS - physics double majors 2 triple majors Then jM \Ej D 4C2, jM \Pj D 3C2,
jE\Pj D 11C2, and jM \E\Pj D 2. Plugging all this in

Hint: an D a2log2 n . (b) You may assume that if f .n/ 1 and g.n/ 1 for all n, then f g ! f 1 n g 1 n . Show
that pn n D .n/: Problem 14.37. (a) Define a function f .n/ such that f D .n2 / and NOT.f n 2 /. f .n/ D (b)
Define a function g.n/ such that g D

word BOOKKEEPER is: total letters 10 1 Bs 2 Os 2 Ks 3 Es 1 Ps 1
Rs This example generalizes directly to an exceptionally useful counting principle which we will call
the Rule 15.6.3 (Bookkeeper Rule). Let l1; : : : ; lm be distinct elements. The number o

the information available to the Assistant, namely, a set of 5 cards. So the set X of left-hand vertices will
have 52 5 elements. Each vertex on the right will correspond to the information available to the
Magician, namely, a sequence of 4 distinct cards

Rule lets us count one thing by counting another. This suggests a general strategy: get really good at
counting just a few things, then use bijections to count everything else! This is the strategy well follow.
In particular, well get really good at count