3
$\begingroup$

This question already has an answer here:

I have this question for a homework. The question stems from the fact that you can determine whether a regular language is empty by using a Turing machine to count the states n in the given FSM. When you generate all strings from length 0 to n, if the machine accepts any of them then the language is non-empty. We don't have to check words with length > n because of the pumping lemma. The question claims that you can solve the decision problem for finiteness in a similar way.

I know intuitively that a regular language is finite if its finite, well-formed regular expression does not contain a Kleene star, but I don't know how to convert this notion around. My thought is that we have to know if there are any words in the language whose length is greather than n, but that requires checking all words.

Then I thought: Have the machine count the number of states n in the FSM. Generate all of the strings of length 0 to n. Then, check every word to see if the only possible way to pump this word xyz is to make y≡λ. If every word pumps only according to this condition, then the language is finite. However, this feels somehow incomplete.

Could someone give me a hint or push me in the right direction? Thanks.

$\endgroup$

marked as duplicate by xskxzr, David Richerby, Evil, Apass.Jack, Discrete lizard Mar 28 at 18:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ If you have a decider on regular expressions, what's the big deal? Convert the automaton to regular expressions (that's certainly computable) -- reduction obtained. $\endgroup$ – Raphael Apr 7 '16 at 7:45
  • $\begingroup$ Alternatively, look at the proof of the Pumping lemma and see where the pumping comes from. That gives you one direction of the proof. $\endgroup$ – Raphael Apr 7 '16 at 7:46
1
$\begingroup$

Show that an NFA accepts an infinite language if and only if there is a (directed) path from the initial to an accepting state which contains at least one state more than once.

$\endgroup$
  • $\begingroup$ That's exactly it! I feel silly because we have discussed something similar, but he didn't directly link the ideas. $\endgroup$ – Bronze Apr 7 '16 at 15:39
2
$\begingroup$

If $L$ is infinite, it contains strings of unbounded length. Think about the sequence of states visited by the automaton when these strings are accepted. This will give you a condition of the form "$M$ accepts an infinite language implies $X$". Now check that it's actually "if and only if $X$."

$\endgroup$
  • $\begingroup$ I believe what you're hinting at is that a FSM that accepts an infinite language will have to visit at least one state at least twice. Clearly, a language is finite if none of the words cause the FSM to visit any state more than once. But I'm still stuck; we can't endlessly generate strings waiting waiting for one that visits a state twice. $\endgroup$ – Bronze Apr 7 '16 at 0:55
  • $\begingroup$ @user327716 Look at the automaton, not the strings. $\endgroup$ – David Richerby Apr 7 '16 at 2:42
1
$\begingroup$

How about checking all the strings of length $n$ to 2$n$? Would that be helpful to derive the required conclusion?

(In a sense, this is rephrasing your solution, right?)

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.