# CMPSCI 611: Theory of Algorithms

### Questions and Answers on Homework #2

Questions are in black, answers in blue.

• Question 2.10, 8 October: I've got the generalization of Prim for 2.3(d) but I'm having a lot of trouble proving, from the greedoid definition alone, that this general greedy algorithm always works.

That's because it doesn't always work -- you need some additional conditions on either the greedoid or the weight function. Check the revised assignment: I've withdrawn the question and will give you extra credit for coming up with a counterexample. Sorry!

• Question 2.9, 7 October: I'm not clear on how the queue is to be used in Problem 2.5 --could you explain it further? And what is δ*?

First, if w is any string and q is any state of the DFA, δ*(q,w) is the state of the DFA if it starts from q and then reads w. So by definition, the language of the DFA is the set of strings w such that δ*(s,w) is a final state, where s is the start state.

Here is the idea of how the queue works. At the beginning you know that the start states of the two machines must be equivalent to each other. When you find that two states s in one machine and t in the other are equivalent, you know that δ1(s,a) must be equivalent to δ1(t,a) for each possible letter a. So you put each of these pairs on the queue. When you take a pair off the queue, you look and see whether you have already found those two states to be equivalent. If they are, you continue with the next pair on the queue. If they are not, you have discovered a new equivalence and you process it accordingly.

You will have to figure out how many pairs can be added to the queue over the course of the algorithm, in order to find out how long it will take. You will also have to explain further how this equivalence relation tells you whether the two DFA's are equivalent.

• Question 2.8, 7 October: In 2.3, we talk about X being a connected set of edges. Until I get to the end of the algorithm, the vertices of G will not all be connected by X -- the ones incident to X will have paths to each other but the others will still be isolated. By "connected set of edges", do you just mean that any two vertices incident to edges in X have a path in X between them?

Yes, sorry for my imprecise language. The edges in X form a tree from the vertices they touch, but not from all the vertices of G.

• Question 2.7, 7 October: I found a "matroid union theorem" on the web. Why doesn't it prove that I ∪ J is a matroid, contradicting what you ask us to prove in 2.2?

Remember that I and J are each sets of subsets of E. The set I ∪ J is {X: (X ∈ I) ∨ (X ∈ J)}. This need not be a matroid, as I ask you to prove. The matroid union theorem talks about the set of sets K that are the union of any set in I with any set in J. This is what I ask you to prove to be true. So you may use this proof you found, as long as you quote your source and re-express it in your own words.

• Question 2.6, 7 October: I don't understand the difference between the greedy algorithms of 2.3(b) and 2.3(d).

In 2.3(b) your algorithm should be similar to Kruskal, or to the generic greedy algorithm for any subset system. This will not get the maximum element of I in general, which is what you are to show. In 2.3(d) you are to design an algorithm like Prim's, which will get the maximal element of I.

• Question 2.5, 7 October: In Problem 2.1, is an exhaustive search of the possible cases a legitimate way to show that every smaller subset system is a matroid?

Any clear and convincing argument is fine. If you can discover some commonalities among the cases, you can come up with a shorter proof that is nicer for the graders to read.

• Question 2.4, 7 October: Is the parenthetical remark at the end of Problem 2.2 important for solving the problem?

No, that's why it's parenthetical.

• Question 2.3, 5 October: In Problem 2.3, you say that the (E,I) defined in the introduction is a subset system. I don't believe it, because in the text a subset system is defined to be closed downward under inclusion.

You're right, the problem text has been corrected.

• Question 2.2, 2 October 2005: In 2.3, the type of r isn't clear. Is it a vertex or an edge?

Yeah, I messed this definition up badly, check the corrected version.

• Question 2.1, 1 October: In Problem 2.2, don't I and J have to be matroids?

Yes, they are now.