here - CSE @ IITD

CSL 105: Discrete Mathematical Structures
Instructor: Ragesh Jaiswal
This file may get updated. So, please refresh your browser.
1. Given a list of n natural numbers d1 , ..., dn , show how to decide in polynomial time
whether there exists an undirected graph G = (V, E) whose vertex degrees are precisely
d1 , ..., dn . (That is, if V = {v1 , ..., vn }, then the degree of vi should be exactly di .) G
should not contain mtultiple edges between the same pair of nodes, or “loop” edges
(where both end vertices are the same node).
Solution: Consider the following proposition:
• G({d1 , ..., dn }): There exists a graph that has vertices with degrees d1 , ..., dn .
We will prove the following lemma.
Lemma 1. Let d1 ≥ d2 ≥ d3 ≥ ... ≥ dn ≥ 0. G({d1 , d2 , ..., dn }) ↔ G({d2 − 1, d3 −
1, ..., dd1 +1 − 1, dd1 +2 , ..., dn }).
Proof. Showing G({d2 − 1, d3 − 1, ..., dd1 +1 − 1, dd1 +2 , ..., dn }) → G({d1 , d2 , ..., dn }) is
simple. Consider a graph G with degrees d2 − 1, d3 − 1, ..., dd1 +1 − 1, dd1 +2 , ..., dn . We
can add a vertex and add edges from this vertex to the first d1 vertices of G to construct
G0 that has the required degrees.
Proving G({d1 , d2 , ..., dn }) → G({d2 −1, d3 −1, ..., dd1 +1 −1, dd1 +2 , ..., dn }) is slightly more
involved. Consider a graph G = (V, E) with degrees d1 , ..., dn and let the corresponding
vertices be v1 , ..., vn . Suppose there exists a vertex vi for 2 ≤ i ≤ d1 + 1 such that there is
no edge between v1 and vi . This means that there is an edge between v1 and a vertex vj
such that j > d1 + 1. If di = dj , then we may rename vi as vj . Otherwise if di > dj , we
know that there is a vertex vk , k ∈
/ {1, i, j} such that there is an edge between vi and vk
but there is no edge between vj and vk . We consider another graph G0 = (V, E 0 ) which
is the same as G except that E 0 = E − {(v1 , vj ), (vi , vk )} ∪ {(v1 , vi ), (vj , vk )}. Now, G0 is
a graph that has degrees d1 , ..., dn and there is an edge from v1 to v2 , ..., vi . We continue
with this argument to show that there exists a graph with degrees d1 , ..., dn in which v1
has edges to v2 , ..., vd1 +1 .
The algorithm is very simple from the above lemma. We are interested in knowing
G({d1 , ...dn }). From the above lemma, this is the same as G({d1 −1, ...dd1 +1 −1, dd1 +2 , ..., dn }).
So we can build a simple recursive algorithm with appropriate base case and then show
its correctness using induction.
1
2. Suppose that 21 girls and 21 boys enter a mathematics competition. Furthermore, suppose that each entrant solves at most six questions, and for every boy-girl pair, there
is at least one question that they both solved. Show that there is a question that was
solved by at least three girls and at least three boys.
Solution: Consider a 21 × 21 grid. The rows corresponding to the boys and the columns
corresponding to the girls. For all i, j, if the ith boy shares a question q with the j th girl
such that there are at least two more girls who solved q, then we put a red ball into the
cell (i, j). If ith boy shares a question q with the j th girl such that there are at least two
more boys who solved q, then we put a blue ball into the cell (i, j). We now show an
interesting property regarding the number of same colored balls in a row or column.
Lemma 2. Each row contains at least 11 red balls and each column contains at least 11
blue balls.
Proof. We will just prove for the rows and the statement about columns follows by a
symmetric argument. For any i, we will argue that out of the questions that the ith boy
solves, there are at most 5 distinct questions such that for any such question there are at
most 2 girls who solved it. This follows by the Pigeonhole principle. Since otherwise the
ith boy solves more than 6 distinct questions. This set of at most 5 questions, covers only
2 × 5 = 10 girls with whom boy i shares a question. This means that with the remaining
11 girls, this boy shares a problem that is solved by at least two other girls. Note that
whenever it shares such a question with girl j, we put a red ball in the cell (i, j). So,
there are at least 11 red balls in any row of the grid.
From the above lemma, we know that the total number of balls is at least 2 × 21 × 11.
This is greater than the total number of cells which is 21 × 21. So, by the Pigeonhole
principle, there is a cell that contains both blue and red ball. But then this means that
the question that is shared in this cell is solved by at least 3 boys and at least 3 girls.
2