You are on page 1of 2

Homework 5 : Chapter 5.1~5.

2
- Section 5.1 (page 344) =7,a,9,10,19,24,32,3s,39,43,44,47
8.
There are 26 choices for the rst initial, then 25 choices for the second, if no letter is to
be repeated, then 24
choices for the third. (We interpret repeated broadly, so that a string like RWR, for
example, is prohibited,
as well as a string like RRW.) Therefore by the product rule the answer is 26 - 25 - 24 =
15,600.
10 We have two choices for each bit, so there are 28 = 256 bit strings.
24
a) There are 10 ways to choose the rst digit, 9 ways to choose the second, and so on;
therefore the answer
is 10-9-8-7=5040.
b) There are 10 ways to choose each of the rst three digits and 5 ways to choose the last;
therefore the
answer is 103 - 5 = 5000.
c) There are 4 ways to choose the position that is to be different from 9, and 9 ways to
choose the digit to
go there. Therefore there are 4 - 9 = 36 such strings.
32.
In each case the answer is 1110, where n is the number of elements in the codomain,
since there are n choices
for a function value for each of the 10 elements in the domain.
a) 210 = 1024 b) 310 = 59,049 0) 410 = 1,048,576 d) 510 = 9,765,625
44 .
First we count the number of bit strings of length 10 that contain ve consecutive 0s. We
will base the count on where the string of ve or more consecutive 0s starts. If it starts in
the rst bit, then the rst ve bits are all 0s, but there is free choice for the last ve bits;
therefore there are 25 = 32 such strings. If it starts in the second bit, then the rst bit must
be a 1, the next ve bits are all 0s, but there is free choice for the last four bits; therefore
there are 24 = 16 such strings. If it starts in the third bit, then the second bit must be a 1
but the rst bit and the last three bits are arbitrary; therefore there are 24 = 16 such
strings. Similarly,there are 16 such strings that have the consecutive 0s starting in each of
positions four, ve, and six. Thisgives us a total of 32 + 5 - 16 = 112 strings that contain
ve consecutive 0s. Symmetrically, there are 112 strings that contain ve consecutive

1s. Clearly there are exactly two strings that contain both (0000011111 and 1111100000).
Therefore by the inclusionexclusion principle, the answer is 112 + 112 2 = 222.

- Section 5.2(page 353) :6,8,11,15,20,39


6. There are only d possible remainders when an integer is divided by d, namely 0, 1, ...,
d 1.By the pigeonhole principle, if we have d + 1 remainders, then at least two must be
the same.
8. This is just a restatement of the pigeonhole principle, with k = |T|.
20. One maximal length increasing sequence is 5,7, 10, 15, 21. One maximal length
decreasing sequence is 22, 7,3.
See Exercise 23 for an algorithm.

You might also like