You are on page 1of 4

Test 1

05-09-2017

1. a. Sum all positive integers less than 10, 000 made up using only the digits 1, 5, and 9 (repetition
allowed).
Solution. Positive integers less than 10, 000 can have one, two, three, or four digits. In each
such integer, in each place (unit’s place, ten’s place, etc.), the possible digits are 1, 5, and 9.
Consider all four digit integers with 1, 5, and 9 as its digits. To sum all these integers, we
may separately sum their unit’s places, then sum their ten’s places and multiply this by
10, then sum their hundred’s places and multiply this by 100, then sum their thousand’s
places and multiply by 1000, and then find the total. The number of such integers with 1
in the unit’s place is 33 = 27, since the other two places can have any of the three digits.
Similarly, the number of such integers with 5 in the unit’s place, and with 9 in the unit’s
place, is also 33 = 27 each. Thus, the if we add all the unit’s place of these integers, we
get 27 × (1 + 5 + 9) = 405. The same reasoning holds for the ten’s and hundred’s places as
well. Thus, the sum of all three digit positive integers formed using the digits 1, 5, and 9 is
405 + 10 × 405 + 100 × 405 + 1000 × 405 = 449955.
Similarly, for finding the sum of all three digit numbers formed using these digits, first
observe that 9 × (1 + 3 + 5) = 135. Then the total is 135 + 10 × 135 + 100 × 135 = 14985.
Since 3 × (1 + 5 + 9) = 45, the sum of all two digit numbers formed using these digits is
45 + 10 × 45 = 495.
The sum of all one digit numbers formed using these digits is 1 + 5 + 9 = 15.
Thus, the required sum is 15 + 495 + 14985 + 449955 = 465450.
b. How many ways can you select 12 flowers for a bouquet from roses, lilacs, tulips, and lilies,
with between 2 and 5 of each kind?
Solution. The (ordinary) generating function for the selections has four brackets, one for
each kind of flower, of the form x2 + x3 + x4 + x5 , since at least two and at most five of each
kind should be selected. Therefore, the generating function is

g(x) = (x2 + x3 + x4 + x5 )4
= x8 (1 + x + x2 + x3 )4
= x8 (1 − x4 )−4 (1 − x)−4 .

The answer is then the coefficient of x12 in the expansion of g(x), which equals the coefficient

1
VM

of x4 in (1 − x4 )−4 (1 − x)−4 , which is


4+4−1
! !
4
1× − × 1 = 31.
4 1

2. a. Count the anagrams of DACTYLONOMY with Ys non-adjacent.


Solution. The word dactylonomy means counting on fingers. However, here we must count
using some combinatorial techniques. The total number of anagrams, i.e., rearrangements
11!
of the letters, of DACTYLONOMY is , since O and Y occur twice each.
2! × 2!
The anagrams in which the Ys are adjacent can be counted by considering the two (adjacent)
10!
Ys as one letter. Thus, there are such anagrams. Therefore, the number of anagrams with
2!
the Ys non-adjacent is
11! 10! 9!
− = 45 × .
2! × 2! 2! 2
b. Show that the number of partitions of 2n + k into n + k parts is independent of k.
Solution. The Ferrers diagram of any partition of 2n + k into n + k parts has exactly n + k
rows – i.e., its first (left-most) column has n + k dots. If we remove this column, we obtain the
Ferrers diagram of a partition of n. On the other hand, the Ferrers diagram of any partition
of n has at most n rows, which means that it is always possible to add one column of n + k
dots to it (on the left) and obtain the diagram of a partition of 2n + k into n + k parts. This
shows that there is a one-to-one correspondence between partitions of 2n + k into n + k parts,
and partitions of n, so that the partitions of the two kinds are equinumerous. Since the latter
is independent of k, so is the former.
3. a. How many ways can 13 identical apples be given to 5 children if each child receives at least
one apple.
Solution. Since each child must receive at least one apple, and all the apples are identical,
we can first give one apple to each child, leaving eight apples to be distributed in any manner
to five children. The number of ways of doing this is
5+8−1
! !
12
= = 495.
8 8

b. Enumerate the n-digit ternary sequences with total number of 0s and 1s odd.
Solution. In a ternary sequence, the total number of 0s and 1s is odd if and only if it has
either an even number of 0s and an odd number of 1s, or else, an odd number of 0s and
an even number of 1s. Since a sequence is an arrangement, the generating function will be
exponential.
Corresponding to an even number of 0s, the generating function will have a factor of the
form
x2 x4 ex + e−x
1+ + + ··· = .
2! 4! 2

2
VM

Corresponding to an odd number of 1s, the generating function will have a factor of the form

x3 x5 ex − e−x
x+ + + ··· = .
3! 5! 2
Since there is no restriction on the number of 2s in the sequence, the corresponding factor is

x2
1+x+ + · · · = ex .
2!
Thus, the term of the generating function corresponding to the first case, i.e, an even number
of 0s and an odd number of 1s, is
e + e−x ex − e−x x e3x − e−x
 x  
e = .
2 2 4
The term of the generating function corresponding to the second case, i.e., an odd number
of 0s and an even number of 1s, will just have the first and second factors interchanged, but
this gives us the same term.
Thus, the exponential generating function is
!
e3x − e−x e3x − e−x
g(x) = 2 = .
4 2

xn
Then the required number of sequences is the coefficient of in the expansion of g(x), which
n!
is
3n − (−1)n
.
2

4. a. Sum all 4-digit integers with digits 0, 3, 6, 9, without repetition.


Solution. We sum the digits in each place individually, then find the total. If 0 is in the
unit’s place, then the other three digits can be permuted in all 3! = 6 ways, so that there are 6
integers ending in 0. But if 3 is in the unit’s place, then the first digit can only be 6 or 9 (since
we consider only three digit integers). There are 2 × 2! = 4 such integers. Similarly, there
are 4 integers each ending in 6 and ending in 9. Thus, the sum of the unit’s places of all the
integers is 6 × 0 + 4 × 3 + 4 × 6 + 4 × 9 = 72.
Similarly, the sums of the ten’s and hundred’s places of all the integers are also 72 each.
For the thousand’s place, that is, the first digit, the only possible digits are 3, 6, and 9. If 3
is in the thousand’s place, then the other three digits can be permuted freely in all 3! = 6
ways. Thus, there are 6 integers with 3 in the thousand’s place. Similarly, there are 6 integers
each with 6 and 9 in the thousand’s place. Thus, the sum of all the thousand’s places is
6 × 3 + 6 × 6 + 6 × 9 = 144.
The required sum is therefore 72 + 10 × 72 + 100 × 72 + 1000 × 144 = 151992.
b. How many ways can you give each of 12 friends one flower, if you have to give at least two
each of roses, lilacs, tulips, and lilies?

3
VM

Solution. Since each friend is a different person, we need to use an exponential generating
function. The factor of the generating function corresponding to each flower is

x2 x3 x4
+ + + · · · = ex − x − 1,
2! 3! 4!
considering that we have to give at least two of each flower. Thus, the generating function is

g(x) = (ex − x − 1)4 = (ex − (x + 1))4


= e4x − 4(x + 1)e3x + 6(x + 1)2 e2x − 4(x + 1)3 ex + (x + 1)4
= e4x − 4(x + 1)e3x + 6(x2 + 2x + 1)e2x − 4(x3 + 3x2 + 3x + 1)ex + (x + 1)4
= e4x − 4e3x + 6e2x − 4ex − 4x(e3x − 3e2x + 3ex ) + 6x2 (e2x − 2ex ) − 4x3 ex + (x − 1)4 .

x12
The required answer is then the coefficient of in the expansion of g(x), which is
12!
412 − 4 × 312 + 6 × 212 − 4 − 4 × 12(311 − 3 × 211 + 3) + 6 × 12 × 11(210 − 2) − 4 × 12 × 11 × 10
= a mildly interesting number.

Challenge: Prove that there is no uninteresting positive integer.

5. a. Enumerate anagrams of ABECEDARIAN with Es non-adjacent.


Solution. Abecedarian is a word meaning “arranged alphabetically”. Nevertheless, we have
to count all anagrams of ABECEDARIAN in which the Es are non-adjacent. The total number
11!
of anagrams of this word is , since A and E occur 3 and 2 times respectively. Of these,
3! × 2!
10!
anagrams have adjacent Es (considering the adjacent Es as a single letter). The required
3!
number of anagrams is, therefore,

11! 10! 9
− = × 10!.
3! × 2! 3! 12

b. Show that the number of partitions of n with k parts is equal to the number of partitions of
n with largest part k.
Solution. The Ferrers diagram of any partition of n with k parts has n dots and exactly k
rows. In particular, this means that the first column of the diagram has k dots. The conjugate
of this diagram will have exactly k dots in the first row, which represents the largest part of
the corresponding partition. Thus, the conjugate of a partition of n into k parts is a partition
of n in which the largest part is k. Since conjugation is an invertible operation, there is
a one-to-one correspondence between partitions of n into k parts and partitions of n with
largest part k, which shows that they are equinumerous.

You might also like