# Homework #7 Questions and Answers

### Question 7.5, 1 May 2005

A couple questions on 9.3.4 and 9.3.5:

The homework page has the hint: "For 9.3.5, you may find it useful by beginning with the cases of k=0, k=1, and k=2 and then generalizing your answer." That hint is actually for 9.3.4, correct? 9.3.5 doesn't have a k.

Yes, thanks, I'll put this correction on the q&a.

But assuming that hint is for 9.3.4, what exactly are we supposed to do for a DFA? It's not possible to make a general DFA that works for an unknown k, is it?

Yes, any given DFA will be correct for at most one k, so I want different DFA's for each k.

Are we supposed to draw DFAs for k = 0, 1 and 2?

Yes, unless your answer for general k is complete enough to already make the pictures for those k clear.

Does proving it's minimal mean going through the process we did in discussion?

Either that, or arguing directly for every pair of states that they cannot be collapsed, as on page 9-10.

I suppose I can show that the process in general in general will work for any k, but I'm unclear as to exactly what "finding a DFA" means.

I mean to describe a set of DFA's, one for each k, or just describing in generic terms what the minimal DFA looks like for a generic k. For example, if the language were "the set of strings with a number of a's that is divisible by k", I could say "the DFA has k states, numbered 0 through k-1, the start state is 0, the only final state is 0, there is a b-loop on each state, and there is an a-arrow from state i to state (i+1)%k for each i".

On 9.3.5: What types are u, v, and w? Are they all strings or letters? If they're strings, isn't the thing we're proving always true (even outside this problem) because w could just equal uv? Should we add a condition that uv != w? And are we allowed to use properties of DFAs in this proof, or are we just supposed to stick with L-equivalence and equivalence relation properties?

Crap. Yes, u,v, and w are all strings, and the statement I asked you to prove is trivially true as you say, without using the condition. What I meant to say was "forall u forall w exists v: uv = w", but it's too late to change now. There is still one interesting fact about paths in the minimal DFA you can come up with, even though this is now just a generic minimal DFA. What do you know about which states have paths to which other states? (For example, the condition I meant would have forced every state to have a path to every other state.)

You should certainly use what you know about DFA's, but you will need properties of L-equivalence to talk about the _minimal_ DFA.

### Question 7.4, 30 April 2005

In 8.3.2, should we assume that all edges have length 1?

Yes, we haven't really talked about the length of edges this term, so that "length of path" refers to the number of edges in the path. So this implicitly gives a length of 1 to each edge as you say. If edges could have length greater than 1, the result you are asked to prove in 8.3.2 would not be true.

### Question 7.3, 28 April 2005

In Problem 9.3.4, what is the alphabet Σ?

Sorry, it is {a,b} as usual, I should have said that.

### Question 7.2, 28 April 2005

In Section 9.3, I'm confused by the notation ≡L from the book -- I don't remember it from lecture.

Sorry, that's because I used "∼L" in lecture instead. Both are intended to mean "is L-equivalent to" or "is L-indistinguishable from". Remember that "x ≡L y" is true if and only if for any string z, (xz ∈ L) ↔ (yz ∈ L).

### Question 7.1, 28 April 2005

In Problem 8.3.2, what do you mean by "our observation above"?

Sorry, that isn't very clear. The reference is to the first bullet of the list in Section 8.3.2, which essentially says "∀n:∀G:∀k:∀i:∀j: If G is a graph with n vertices and there is a path of length k from i to j in G, then there is a path from i to j in G of length at most n-1". In Problem 8.3.2 we are proving this fact by letting n and G be arbitrary and using induction on k. The base cases where k ≤ n-1 are easy to prove. If k > n-1, you need to show that a path of length less than k exists, and then use a strong inductive hypothesis.