Combinatorics
summer term 2017
Solution Sheet 2
Due date: May 8, 2017, 15:30.
Discussion of solutions: May 8, 2017.
Problem 4.
6 points
(a) For how many 7-digit numbers with distinct digits in {1, . . . , 9} the sum of the first
and the last digit is even?
(b) For how many 7-digit numbers with distinct digits in {1, . . . , 9} the digits 1 and 9
do not appear next to each other?
(c) Let 2 ≤ k ≤ n. How many k-combinations of {1, . . . , n} do not contain numbers of
difference 1?
Solution.
(a) Let X denote the set of 7-digit numbers with distinct digits in {1, . . . , 9}. Let Y ⊆ X
denote the set of numbers in X where the sum of the first and the last digit is even.
˙ o denote the partition of Y into disjoint sets Ye and Yo containing the
Let Y = Ye ∪Y
even respectively the odd numbers from Y . If x ∈ Ye , then its first and its last digit are
(distinct) even numbers from {2, 4, 6, 8}, while the remaining digits of x form an arbitrary
5-permutation of the remaining seven numbers from {1, . . . , 9}. Hence
|Ye | = 4 · 3 · P (7, 5) = 12 ·
7!
= 6 · 7!.
2!
Similarly, we see that the first and the last digit of any member of Yo are odd numbers
from {1, 3, 5, 7, 9}, while the remaining digits form an arbitrary 5-permutation of the
remaining seven numbers from {1, . . . , 9}. So
|Yo | = 5 · 4 · P (7, 5) = 10 · 7!.
Altogether
|Y | = |Ye | + |Yo | = 6 · 7! + 10 · 7! = 16 · 7! (= 80640).
(b) Let X denote the set of 7-digit numbers with distinct digits in {1, . . . , 9}. Let Z ⊆ X
denote the set of numbers in X where digits 1 and 9 do not appear next to each other.
˙ 2 ∪Z
˙ 3 ∪Z
˙ 4 , where Z1 contains the elements of Z which
Consider the partition Z = Z1 ∪Z
contain neither 1 nor 9, Z2 contains the elements of Z which contain 1 but not 9, Z3
contains the elements of Z which contain a 9 but no 1, and Z4 contains the elements of
Z which contain a 1 and a 9.
The elements in Z1 are the 7-permutations of {2, . . . , 8}, the elements of Z2 consist of a
6-permutations of {2, . . . , 8} with a 1 inserted at an arbitrary place, and the elements of
Z3 are the 6-permutations of {2, . . . , 8} with a 9 inserted at an arbitrary place. Hence
|Z1 | = P (7, 7) = 7!,
|Z2 | = |Z3 | = 7 · P (7, 6) = 7
7!
= 7 · 7!.
1!
In order to count the elements z ∈ Z4 we count the digits in z distinct from 1 or 9. These
form some 5-permutation of {2, . . . , 8}. Now 1 and 9 are either to the left, to the right,
Maria Axenovich
Torsten Ueckerdt
Jonathan Rollin
www.math.kit.edu/iag6/lehre/combinatorics2017s
Combinatorics
summer term 2017
or between two of these digits, but not at the same position. So there are 6 choices for 1
and 5 choices for 9, thus 30 choices altogether. This shows that
|Z4 | = 30 · P (7, 5) = 30 ·
7!
= 15 · 7!.
2!
Altogether
|Z| = |Z1 | + |Z2 | + |Z3 | + |Z4 | = 7! + 7 · 7! + 7 · 7! + 15 · 7! = 30 · 7!.
(c) Let A denote the set of k-combinations of [n] where the difference of any two members
is greater than 1 (in absolute value). We shall establish a bijection f between A and the
k-combinations of [n − k + 1]. Consider a set X = {a1 , . . . , ak } ∈ A with 1 ≤ a1 < · · · <
ak ≤ n. Let
f (X) = {a1 , a2 − 1, . . . , ak − (k − 1)}.
Then 1 ≤ a1 < a2 − 1 < · · · < ak − (k − 1) ≤ n − k + 1 and f (X) is a k-combination of
[n−k+1]. The other way round consider some k-combination Y = {b1 , . . . , bk } ⊆ [n−k+1]
with 1 ≤ b1 < · · · < bk ≤ n − k + 1. Let
g(Y ) = {b1 , b2 + 1, . . . , bk + k − 1}.
Then 1 ≤ b1 < b2 + 1 < · · · < bk + k − 1 ≤ n and, since bi < bj for i < j, we have
bj + (j − 1) − (bi + (i − 1)) = bj − bi + j − i ≥ 2. Hence g(Y ) ∈ A. Moreover g(f (X)) = X
for each X ∈ A and f (g(Y )) for each k-combination Y of [n − k + 1]. So f is a bijection.
This shows that
n−k+1
|A| =
.
k
Problem 5.
6 points
th
To celebrate the 200 birthday of the bicycle, two Ferris wheels are installed in front
of the Karlsruhe Palace, with 24 cabins each. Suppose that the cabins are painted red
and yellow, such that one of the wheels has exactly twelve red and twelve yellow cabins.
Prove that there are rotations of the wheels such that for at least half of the cabins of
one wheel, the cabin that is at the same position on the other wheel is of the same color.
Figure 1: For each of the ten marked positions the colors of the two cabins at this position on the two
wheels coincide, while the colors differ for the other positions.
Maria Axenovich
Torsten Ueckerdt
Jonathan Rollin
www.math.kit.edu/iag6/lehre/combinatorics2017s
Combinatorics
summer term 2017
Solution.
We call the wheels W1 and W2 and consider W1 in a fixed position. Then there are 24
possible rotations of W2 such that cabins of W2 are at same positions as the cabins in W1 .
Consider an arbitrary cabin C of W2 . Then there are exactly 12 such rotations where the
color of C matches the color of the cabin which is at the same position in W1 . Summing
over all rotations and over all cabins of W2 we see that there are 12 · 24 such matches.
Now by the pigeonhole principle there is one of the 24 rotations of W2 where at least
12·24
= 12 matches occur.
24
Problem 6.
6 points
Consider 0 ≤ k ≤ r and (not necessarily disjoint) sets A1 , . . . , An of size r each. Let
X = A1 ∪ · · · ∪ An and let d(x) be the number of sets among A1 , . . . , An containing x.
P
P
(a) Prove that x∈Ai d(x) = nj=1 |Ai ∩ Aj | for each i ∈ [n].
P P
P
(b) Prove that ni=1 x∈Ai d(x) = x∈X d(x)2 .
(c) Suppose that |Ai ∩Aj | ≤ k for all i, j ∈ [n], i 6= j. Prove that |X| ≥ r2 n/(r+(n−1)k).
2
P
P
1
You may use Jensen’s inequality x∈X d(x)2 ≥ |X|
without proof.
x∈X d(x)
Solution.
(a) Consider some i ∈ [n] and the number N of pairs (x, Aj ) where x ∈ Ai ∩ Aj , j ∈ [n].
By double counting we have
X
x∈Ai
d(x) =
X
|{j ∈ [n] | x ∈ Aj }| = N =
x∈Ai
X
|{x | x ∈ Ai ∩ Aj }| =
n
X
|Ai ∩ Aj |.
j=1
j∈[n]
(b) We shall double count the number M of tuples (x, Ai , Aj ) with x ∈ Ai ∩ Aj , i, j ∈ [n].
On the one hand we have
X
X
d(x)2 .
M=
|{(Ai , Aj ) | x ∈ Ai ∩ Aj }| =
x∈X
x∈X
On the other hand
M=
X
(a)
|{(x, Aj ) | x ∈ Ai ∩ Aj }| =
XX
d(x).
i∈[n] x∈Ai
i∈[n]
(c) We shall use the two identities from above to give bounds on
the one hand we have for each i ∈ [n] that
X
(a)
d(x) =
x∈Ai
n
X
|Ai ∩ Aj | = |Ai | +
j=1
X
Pn P
i=1
x∈Ai
d(x). On
|Ai ∩ Aj | ≤ r + (n − 1)k.
j6=i
Summing this over all i yields
n X
X
i=1 x∈Ai
Maria Axenovich
Torsten Ueckerdt
Jonathan Rollin
d(x) =
n X
n
X
|Ai ∩ Aj | ≤ nr + n(n − 1)k.
i=1 j=1
www.math.kit.edu/iag6/lehre/combinatorics2017s
Combinatorics
summer term 2017
On the other hand we have
n X
X
i=1 x∈Ai
(b)
d(x) =
X
x∈X
Jensen
d(x)2 ≥
1
|X|
!2
X
x∈X
d(x)
=
1
(rn)2 .
|X|
P
The last equality is obtained from x∈X d(x) = rn which is proved, similar to part (a),
by double counting pairs (x, A) with x ∈ A, A = Ai for some i ∈ [n]. Combining these
two inequalities yields the result.
Maria Axenovich
Torsten Ueckerdt
Jonathan Rollin
www.math.kit.edu/iag6/lehre/combinatorics2017s
© Copyright 2026 Paperzz