1

So I've seen this claim being made on different questions:

Do self-loops in DFA cause infinite languages?

I'd like to find formal proof for this.

I think I should also note that an "accepting path containing a cycle" is probably defined as a path in a graph so that the states in the DFA are nodes in the graph and there must be a cycle and at least one accepting state in that path.

crommy
  • 113
  • 2

1 Answers1

2

If the DFA contains a path from the start node to an accepting state that contains a cycle, then the DFA is an infinite language. The proof is easy: you can go around the cycle as many times as you like. Depending on how many times you go around the cycle, you get a different word accepted by the DFA; the more times around the cycle, the longer the word (so it has to be different from any word where you went around the cycle a different number of times). There are infinitely many possibilities for how many times you can choose to go around the cycle, so infinitely many words accepted by the DFA.

D.W.
  • 167,959
  • 22
  • 232
  • 500