Graph Theory
Spring 2013
Prof. János Pach
Assist. Filip Morić
Exercise sheet 2: Solutions
Caveat emptor: These are merely extended hints, rather than complete solutions.
1. Let A be a matrix whose entries are 0 or 1. Show that the minimum
number of lines (i.e., rows or columns) of A that contain all the 1’s of
A is equal to the maximum number of 1’s in A, no two on a line.
Solution. Consider A as a bipartite adjacency matrix of a graph
G[X, Y ]. The minimum number of lines that contain all the 1’s corresponds to the minimum size of a vertex cover in G, while the maximum
number of 1’s no two on a line corresponds to the maximum size of a
matching. Thus, the statement follows from König’s theorem.
2. Denote by Gn the graph whose 2n vertices are a1 , b1 , . . . , an , bn and
whose edges are ai ai+1 , bi bi+1 (1 ≤ i ≤ n − 1) and ai bi (1 ≤ i ≤ n).
Find the number of 1-factors in Gn .
Solution. Denote the result by xn . Clearly, x1 = 1 and x2 = 2.
Observe that any 1-factor of Gn is of one of the following two types:
either the edge an bn plus a 1-factor of Gn−1 , or the edges an−1 an and
bn−1 bn plus a 1-factor of Gn−2 . We get xn = xn−1 + xn−2 . It follows
that xn = Fn+1 , where (Fn ) is the Fibonacci sequence.
3. Show that it is impossible, using 1 × 2 dominoes, to tile an 8 × 8
chessboard from which two opposite 1 × 1 corner squares, a1 and h8,
have been removed.
Solution. Since the removed squares are both white, there are 30 white
and 32 black squares left. Each domino, however, covers one black
and one white squares, hence a complete tiling is impossible. (One
is implicitly talking about a bipartite graph in which the number of
vertices is not the same in both parts, which implies that there is no
perfect matching.)
4. (a) Let G[X, Y ] be a bipartite graph such that d(x) ≥ 1 for all x ∈ X
and d(x) ≥ d(y) for all xy ∈ E, where x ∈ X and y ∈ Y . Show
that G has a matching covering every vertex of X.
Graph Theory
Spring 2013
Prof. János Pach
Assist. Filip Morić
(b) Let G[X, Y ] be a bipartite graph in which each vertex of X is
of odd degree. Suppose that any two vertices of X have an even
number of common neighbors. Show that G has a matching covering every vertex of X.
Solution. (a) Suppose the contrary, i.e., there’s no matching of X.
Then by Hall’s theorem there is a subset A ⊆ X such that |A| >
|N (A)|. Choose among such sets A one whose cardinality is the
smallest. Clearly, |A| > 1. Take an arbitrary x ∈ A. By assumption, there is a matching of A − {x}, and moreover |N (A)| =
|N (A − {x})| = |A| − 1. Hence, we get
X
X
X
X
d(v) >
d(v) ≥
d(v) =
d(v) ,
v∈A
v∈A−{x}
v∈N (A−{x})
which is a contradiction, since
be satisfied.
P
v∈A d(v)
v∈N (A)
≤
P
v∈N (A) d(v)
must
(b) For an arbitrary A ⊆ X consider the bipartite adjacency matrix
between A and N (A). The idea is to consider this matrix over
GF (2). Since any two rows are orthogonal, we conclude that the
rows are linearly independent (that is, by summing up several rows
we cannot get another row). This is only possible if |A| ≤ |N (A)|,
and we are done by Hall’s theorem.
5. A game is played as follows. Two players alternately select distinct
vertices v0 , v1 , v2 , . . . of a graph G, where, for i ≥ 0, vi+1 is required
to be adjacent to vi . The last player able to select a vertex wins the
game. Show that the first player has a winning strategy if and only if
G has no perfect matching.
Solution. If there is a perfect matching ai bi for i = 1, 2, . . . , then the
second player can win as follows: whenever the first player chooses ai ,
he chooses bi in his next move, and vice versa.
Suppose there is no perfect matching. Then the first player can win if
he plays as follows. Let M be a maximum matching. The first player
starts with a vertex v0 not covered by the matching. In the sequel,
before the game ends, the first player can ensure that v2k vv2k+1 is an
edge from E \ M (where v2k+1 is covered by M ), while v2k+1 v2k+2
is from M , for k ≥ 0. This follows from the fact that there is no
augmenting path for M .
Graph Theory
Spring 2013
Prof. János Pach
Assist. Filip Morić
6. (a) Take a standard deck of cards, and deal them out into 13 piles
of 4 cards each. Show that it is always possible to select exactly
1 card from each pile, such that the 13 selected cards contain
exactly one card of each rank (ace, 2, 3, . . . , queen, king).
(b) Let H be a finite group and let K be a subgroup of H. Show that
there exist elements h1 , h2 , . . . , hn ∈ H such that h1 K, h2 K, . . . ,
hn K are the left cosets of K and Kh1 , Kh2 , . . . , Khn are the right
cosets of K.
Solution. (a) Consider a bipartite graph G[X, Y ], where X is the set
of 14 piles and Y is the set of 14 possible ranks, and each pile is
connected by an edge with the ranks that appear in it. Clearly, for
any k piles, there are at least k ranks appearing in them. Thus,
the marriage condition is satisfied, and therefore we have a perfect
matching.
(b) Same as (a). Consider the right and the left cosets, and connect
a right poset with a left poset if their intersection is nonempty.
Since the cosets are all of the same cardinality, the marriage condition is satisfied, and there’s a perfect matching.
7. Two people perform a card trick. The first performer takes 5 cards
from a 52-card deck (previously shuffled by a member of the audience),
looks at them, keeps one of the cards and arranges the remaining four
in a row from left to right, face up. The second performer guesses
correctly the hidden card. Prove that the performers can agree on a
system which always makes this possible, and devise one such system.
Solution. Let’s consider a bipartite graph G[A, B], where A is the set
of 5-subsets of the deck, B is the set of ordered 4-tuples of cards, and
ab is an edge iff the quadruple b ∈ B is contained in the quintuple
a ∈ A. It suffices to show that this graph has a matching of A. This
follows from Hall’s theorem, since G is semi-regular: the vertices in A
have degree 5! = 120, while the vertices in B have degree 52 − 4 = 48.
This gives the existence, but also a concrete strategy, at least in principle (this method does not give a clue as to how to compute a desired
matching without much pain).
Alternative solution. Let the five cards be a1 , . . . , a5 , with 1 ≤ a1 <
a2 < · · · < a5 ≤ 52. We can arrange any 4 cards in 4! = 24 ways, and
we can order all these permutations lexicographically. The position of a
Graph Theory
Spring 2013
Prof. János Pach
Assist. Filip Morić
permutation in such an ordering we call the rank of the permutation.
We have that either a5 − a4 ≤ 24 or (a1 + 52) − a5 ≤ 24. If the
first case occurs, we hide the card a5 and make the remaining 4 cards
form the permutation of rank a5 − a4 . Otherwise, we hide the card a1
and arrange the remaining cards according to the permutation whose
rank is (a1 + 52) − a5 . That’s the job of the first performer. Now the
second performer computes the rank of the permutation and adds it to
the largest card. If the result is not more than 52, that’s the answer,
otherwise, she subtracts 52 to get the answer.
If you spot any mistakes on this sheet, please drop an email to [email protected].
© Copyright 2026 Paperzz