2024S Discrete Maths HW 1 Solution
2024S Discrete Maths HW 1 Solution
2024S Discrete Maths HW 1 Solution
1. How many 4-digit integers greater than 5400 have both of the following properties?
(a) The digits are distinct; (b) the digits 2 and 7 do not occur.
Solution: Partition the set of integers satisfying the conditions into two disjoint sub-
sets: those between 6000 and 9999 and those between 5400 and 5999. The first subset
has 3 × 7 × 6 × 5 = 630 integers, where 3 is the number of choices (i.e., 6, 8, 9) for the
thousands digit, and the other terms are the number of choices for the remaining digits
(in an arbitrary order) under the constraint of not being 2, 7 nor any other already
chosen digits. The second subset has 4 × 6 × 5 = 120 integers (all starting with 5),
where 4 is the number of choices (4, 6, 8, 9) for the hundreds digit, the other terms are
similar to the first case (the distinct digits condition automatically discards the case
of getting 5400). Hence the answer is 630 + 120 = 750.
1
3. A classroom has two rows of eight seats each. There are 14 students, 5 of whom always
sit in the front row and 4 of whom always sit in the back row. In how many ways can
the students be seated?
Solution: There are P (8, 5) ways to arrange seats for the “front row only” students,
and P (8, 4) ways to arrange seats for the “back row only” students. For the remain-
ing 5 students and 7 seats, where are P (7, 5) ways. Therefore the final answer is
P (8, 5)P (8, 4)P (7, 5).
5. There are 20 identical sticks lined up in a row occupying 20 distinct places, in how
many ways can 6 of them to be chosen so that there must be at least 2 sticks between
each pair of chosen sticks?
Solution: We think of the setting as starting with 6 chosen sticks and inserting 14 more
sticks in the row. Label the 7 slots on the left, between, and on the right of the chosen
sticks as x1 , x2 , . . . , x7 . The ways to insert sticks are the same as the non-negative
solutions to x1 + . . . + x7 = 14 with x2 , . . . .x6 ≥ 2. Substituting x′2 = x2 − 2, . . . , x′6 =
x6 − 2, the problem is reduced to counting the number of non-negative solutions to
x1 + x′2 + . . . + x′6 + x7 = 14 − (2 × 5) = 4, which is 4+7−1 10
7−1
= 6
.
6. Prove that the number of permutations of m A’s and at most n B’s equals
m+n+1
.
m+1
is (m+k)! = m+k
Solution: The number of permutations of m A’s and k B’s m!k! k
. Summing
m m+1 m+n
over all k = 0, 1, . . . , n, we have 0 + 1 + . . . + n . Replacing the first term by
m+1 m+j
m+j m+j+1
0
(which is also 1) and repeatedly using the formula j−1
+ j
= from
m+n+1
j m+n+1
the left (or equivalently, apply induction on n), the sum is equal to n
= m+1 .
Alternative Solution: Every permutation of m + 1 A’s and n B’s can be made into
a permutation of m A’s and at most n B’s by removing its last A and every B that
comes afterward; conversely, starting with a permutation of m A’s and n − k B’s, we
can append one A and k B’s after it to obtain a permutation of m + 1 A’s and n
B’s. It is easy to check that the two operations are inverses of each other, therefore
both are bijections. So the answer to the original question is equal to the number of
m+n+1
permutations of m + 1 A’s and n B’s, which is m+1 .