Escolar Documentos
Profissional Documentos
Cultura Documentos
into k subsets;
we can add b to any one of those subsets to arrive at a partition of B.
This gives us k
_
n
k
_
ways to partition B into k subsets. Additionally,
there are
_
n
k1
_
ways to partition B
i=1
_
6
i
_
= 1 + 31 + 90 + 65 + 15 + 1 = 203
The numbers given by
_
n
m
_
are called Stirling numbers of the second
kind, and can also be calculated by evaluating
_
n
k
_
=
1
k!
k1
i=0
(1)
i
_
k
i
_
(k i)
n
.
4. Do Question 46, p. 312 of the text. Treat upper case and lower case
letters as distinct (e.g. x and X).
The name of a variable in the C programming language is a string that
can contain uppercase letters, lowercase letters, digits, or underscores.
Further, the rst character in the string must be a letter, either up-
percase or lowercase, or an underscore. If the name of a variable is
determined by its rst eight characters, how many dierent variables
can be named in C? (Note that the name of a variable may contain
fewer than eight characters.)
4
Solution: There are 26 each of uppercase and lowercase letters, 10 digits,
and 1 underscore. So there are a total of 26+26+1 = 53 choices for the
rst character, and 26+26+1+10 = 63 choices for the other characters.
The variable name can be 1 to 8 characters long, and there are 53(63
i1
)
names of length i, so the the total number of variable names is
7
i=0
53(63
i
) =
53(63
8
1)
62
5. Do Question 18, p. 325 of the text (about coin ipping):
A coin is ipped eight times where each ip comes up either heads or
tails. How many possible outcomes
(a) are there in total?
Solution: 2
8
= 256.
(b) contain exactly three heads?
Solution:
_
8
3
_
= 56.
(c) contain at least three heads?
Solution: 2
8
_
8
2
_
_
8
1
_
_
8
0
_
= 219.
(d) contain the same number of heads and tails?
Solution:
_
8
4
_
= 70.
6. Do Question 19, p. 342 of the text (about identical twins). The answer
is given in the book. You have to work out the details.
Suppose that a large family has 14 children, including two sets of iden-
tical triplets, three sets of identical twins, and two individual children.
How many ways are there to seat these children in a row of chairs if the
identical triplets or twins cannot be distinguished from one another?
Solution: This is a simple example of permutations with indistinguish-
able objects (see Example 8, p. 339 of the text). The answer is
14!
3! 3! 2! 2! 2!
= 302, 702, 400
Note from pjr: Recalling examples we did in class, this is the same
problem as the following: A father brings home a box of 14 Tim Hortons
5
donuts: 3 old fashioned plain, 3 Boston Cream, 2 maple dip, 2 chocolate
glaze, 2 vanilla dip, 1 jelly-lled, 1 walnut crunch. In how many ways
can he feed them to his 14 children (one donut per child, of course)? It
is also the same as the problem of how many distinct strings can you
form from the letters AAABBBCCDDEEFG.
This is, of course, dierent from the problem of how many fathers could
each buy a box of 14 donuts for their respective families with no two
getting the same combination, assuming there are 25 avours available.
Solution (2) to Question (1b) also deals with the same problem. How
many distinct orders of 2 donuts can you have if there are n avours
available? In this case, a set {x, y} corresponds to a pair of donuts of
avours x and y, where x and y are allowed to be the same.
7. Do Question 18, p. 351 of the text (about points in a square).
Show that if ve points are picked in the interior of a square with a side
length of 2, then at least two of these points are no farther than
2
apart.
Solution: Divide the square into four squares as follows:
2
2
1
1 1
1
The diagonal of a 1 1 square measures
2, so if we want our points
to be at least
2 apart, there can be at most one point in each of
the smaller squares (just use Pythagoras theorem). So we can t four
points, with minimum separation of
2, into the large square, but by
the pigeonhole principle, the fth point must be in the same square as
one of the other points. Thus, at least two of the points are no farther
than
2 apart.
6