Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 20 points Q6: 20+10 points Q7: 10 points Total: 100+10 points
Question text is in black, solutions in blue
For Questions 1-4, the graph G has node set {a, b, c, d, e, f} and nine edges: (a, b), (a, c), (a, d), (b, c), (b, e), (c, f), (d, e), (d, f), and (e, f). Recall that "graph" refers to an undirected graph with no self-loops.
The easiest solution to this is to choose any such graph with a
degree sequence different from G's which is (3, 3, 3, 3, 3, 3).
For example, you could have an isolated node and nine of the ten
edges involving the other nodes, which has degree sequence (5, 5, 5,
4, 4, 0). Isomorphic graphs must have the same degree sequence.
Several people chose a graph with the same degree sequence, the
complete bipartite graph K3,3. There are a number of
ways to show that this graph is not isomorphic to G: it is bipartite
while G contains triangles, and it is non-planar (proved in lecture
or by quoting Kuratowski's Theorem) while G is planar (by Question 2).
G is planar, as is easily shown by giving a planar embedding. We can start with the Hamilton circuit a-b-e-f-c-a and place the edges (b, c) and (c, f) inside it and the edge (a, d) outside it. Euler's formula is V - E + F = 2, so since V = 6 and E = 9, F must be 5. The faces of the planar embedding given above are a-b-c, b-e-f-c, d-e-f, a-c-f-d, and the exterior face a-b-e-d.
G has six odd-degree nodes, so it cannot have an Euler circuit (which would require none) or an Euler path (which would require two). It has the Hamilton circuit listed in Question 2 above, and deleting any single edge of this circuit gives a Hamilton path.
G has a chromatic number of 3. A legal 3-coloring could have a and e red, b and f blue, and c and d green. There can be no 2-coloring because G contains several odd cycles, such as a-b-c-a.
I had actually intended to ask the easier problem of building a
circuit tester with a path tester -- for this you build G' by
adding a new node with edges to all the nodes of G, and note that
G' has an H-circuit if and only if G has an H-path.
For the
problem as posed, one solution uses the path tester to tell
whether there is a circuit in G that contains a fixed edge (x, y).
To do this we build G' by adding a new node x' with an edge only
to x, and a new node y' with an edge only to y. Then if G' has an
H-path, it goes from x' to y', and G contains an h-path from x to
y that can be extended to a circuit. To test whether G has
any H-circuit, we run this "circuit containing (x, y)" test
separately either (1) for every edge (x, y) in G, which is
O(n2) tests, or (2) for every edge (x, y) in G where x
is any fixed node, which is O(n) tests. Clearly this is
polynomial time if the assumed H-path tester is polynomial time.
So if the path-tester exists, the polynomial-time circuit-tester
exists and P = NP.
A more elegant solution (which a student in COMPSCI 311 came up
with when this problem was posed there) takes G and builds a single
graph G' that has an H-path if and only if G has an H-circuit. Take
any node x of G and "clone" it, making two nodes x and y that each
have edges to exactly the neighbors of x in G. Then add a node x'
with an edge only to x, and a node y' with an edge only to y. Any
H-path in G' must go from x' to y' and thus include a path from x to
y, which corresponds to an H-circuit in G.
This is very easy given part (a), because a graph has an H-path if and only if it has a simple path with n-1 edges. (Such a path must visit all n vertices, which makes it a Hamilton path.) So if we have the LSP tester, we input the pair (G, n - 1) to it and report the result as that of our path-tester. Thus if the polynomial-time LSP tester exists, so does a poly-time H-path tester and thus (by part (a)) a poly-time H-circuit tester and (by the assumption) P = NP.
We need a bijection from distributions of treats to strings. If a distribution sends w treats to Ali, x to Bingley, y to Cardie, and z to Duncan, our string will be aw-1bx-1cy-1dz-1. This string has length n-4 because w + x + y + z = n, and clearly the letters are in alphabetical order. Given a string awbxcydz, with w + x + y + z = n - 4, we can give w + 1 treats to Ali, x + 1 to Bingley, y + 1 to Cardie, and z + 1 to Duncan, distributing n treats with at least one to each dog as w, x, y, and z are all non-negative integers.
The strings can be counted by the standard "stars and bars" argument. We have n-4 letters (stars) and three barriers between letter types (bars) which can be arranged in C(n-1, 3) ways. Then for n = 3 we have C(2, 3) = 0, for n = 5 we have C(4, 3) = 4, for n = 7 we have C(6, 3) = 20, and for n = 9 we have C(8, 3) = 56.
If the dogs were also identical, we would be looking for a
partition of 13 into four non-negative, distinct parts, or
equivalently a partition of 9 into four distinct parts. There
are exactly three such partitions, and I required you to argue
that they were the only ones. Looking at 13, we can divide into
cases depending on the largest element of the partition. This
cannot be greater than 7 because the other three elements must
be at least 1, 2, and 3 respectively. If it is 7, we must have
7-3-2-1. If it is 6, we must have 6-4-2-1, and if it is 5, we
must have 5-4-3-1. It cannot be 4 because the only way to have
distinct positive parts would be 4-3-2-1 which has too small a
sum.
Once we have solved this problem, the answer to the given
problem is 4! = 24 times greater, because each distribution to
identical dogs corresponds to exactly 4! distributions to
distinguished dogs. So the answer is 3 times 4! or 72.
Many of you started with the n = 13 case of part (b), which
is C(12, 3) = 220 distributions, and tried to subtract the ones
that had two or more dogs getting the same number of treats. I
don't recall whether anyone got the right answer this way, but
several of you were at least close. There are four partitions
of 13 with exactly three equal elements: 10-1-1-1, 7-2-2-2,
4-3-3-3, and 4-4-4-1. Each of these gives four distributions to
distinguished dogs, so we subtract 16 from our original 220.
Then we look at all the partitions with exactly two equal
elements, which we can find by a case analysis on the pair:
9-2-1-1, 8-3-1-1, 7-4-1-1, 6-5-1-1, 8-2-2-1, 6-3-2-2, 5-4-2-2,
6-3-3-1, 5-3-3-2, 4-4-3-2, and 5-5-2-1, eleven in all. Each of
these yields twelve distributions to distinguished dogs, so we
subtract 132 from our remaining 204 to get 72. There are no
partitions of 13 with either four equal elements or two pairs of
equal elements, so we have checked all the cases where any
elements are equal.
TRUE. We have a strongly connected directed graph where every node has an in-degree equal to its out-degree. Every such graph has an Euler circuit, and the number of edges is 2n - 2 because the original tree had n - 1 undirected edges.
FALSE. This would be true for sorting, which has n! different possible outputs, but the median problem has only n. We discussed linear-time algorithms for median, and if this statement were true there would be an Ω(n log n) lower bound for the time.
FALSE. We can carry out a uniform-cost search from each node to see that every other node is within distance 5. Or we could take the 6 by 6 single-step distance matrix and square it, to see that there is a one-step or two-step path of length at most 5 between every pair of distinct nodes.
FALSE. Using Kruskal's algorithm, we take the three edges of weight 3, then the edge (b, e) of weight 2, then the edge (c, f) of weight 3, to get an MST of weight 8. (We don't take (b, c) because it would form a cycle with the already taken (a, b) and (a, c).)
FALSE. Kruskal's algorithm has no ties to break in choosing its first four edges above, and if it then took any other edge than (c, f) the resulting spanning tree would have total weight greater than 8.
FALSE. There could be an edge from a node in Y to a node in X, with positive flow under f, such that we could increase the net flow over f's by decreasing the flow on this edge.
FALSE. Here's a counter example, where each edge has first its capacity and then its flow under the maximum flow f. Source is a and sink is z. We have (a, b, 2, 1), (b, c, 1, 0), (b, e, 1, 1), (c, d, 1, 0), (d, b, 1, 0), and (e, 2, 1, 0). The only saturated edge is (b, e), and since this edge forms a cut by itself the flow is maximum. But there is at least one other unsaturated edge out of each node, except for z.
FALSE. Tucker discusses finding a perfect matching in a bipartite graph by using the polynomial-time network flow algorithm, which is much faster than trying each of the exponentially many bijections.
FALSE. That is the number of ways to place the two R's and then the two S's. But for each such placement there are 6! total anagrams by placing the other six letters in the six remaining positions.
FALSE. It is 2n - 1. The sum from 0 to n of C(n, i) is 2n.
Last modified 14 November 2018