0
  1. Can a finite automaton not have a final state?

For example, for the question "what is the number of states need to accept an empty language?" people answered that one state is enough to accept a empty language that is not final or accepting and have transition to itself on every input.

  1. What is the number of states needed in a DFA to accept an empty language?
gman
  • 145
  • 2
  • 6
  • 2
    There is no requirement that the set of accepting states be non-empty. A DFA must always have an initial state, so the minimum number of states needed to accept the empty language is one. – user208259 Jan 23 '15 at 07:51
  • Thank you, Definition of DFA does not require the set of final states to be non empty. But I got confused by a some materials stating that no of states needed to accept an empty language is 2. – gman Jan 23 '15 at 07:56
  • 1
    Re: "1" it depends who defines it and for what purpose. You can always add an unreachable final state if the definition (in some book etc.) somehow requires it. I can't be bothered to survey the literature for this kind of triviality... but I suspect that in general there's no imposition of the final state set being non-empty. The start state needs to exist [for DFA to make any sense] and so it imposes the requirement that the set of all states be non-empty. – got trolled too much this week Jan 23 '15 at 10:52
  • 2
    And yes there are some books that require the DFA to have at least one final state for whatever reason. – got trolled too much this week Jan 23 '15 at 10:55
  • Thank you @RespawnedFluff, should have added this as an answer. – gman Jan 23 '15 at 10:57
  • Ehh, this is too trivial and mostly hinges on definition(s). What is slightly less trivial is that any DFA accepting a finite language (including the DFA accepting only the empty language) needs to have at least one dead state, i.e. a state from which it can't reach a final/accepting state. This dead state is needed to "sink" all strings that are too long to be in the language. All such dead states can actually be merged into a single one, so without much loss of generality a DFA accepting a finite language can be said to have one (unique) dead state. – got trolled too much this week Jan 23 '15 at 11:40
  • “Final state” is a confusing term because it suggests that there is exactly one final state and tha tthe automaton will finish in the final state. Neither of these is true. An automaton can have zero, one, or many final states. For this reason many people prefer the term "accepting state". – MJD Jan 23 '15 at 13:51
  • @respawned-fluff Interestingly, the link you give indicates that the set of accepting states is a subset of the set of states. It is only in Note 8 (which is inaccurate) that the author says that an automaton should have at least one accepting state. – J.-E. Pin Mar 16 '15 at 18:56

1 Answers1

0

There is a good reason for allowing the set of final (or accepting) states to be empty. You probably know the standard proof that regular sets are closed under complement. Given a complete DFA $(Q, A, \delta, i, F)$ accepting the regular language $L$, the DFA $(Q, A, \delta, i, Q-F)$ accepts the complement of $L$. This is still perfectly true if $F = Q$, in which case $Q-F$ is empty.

In other words, if you were assuming that the set of final states is nonempty, the previous proof would not work in all cases, which would be a pity.

To answer your second question, the minimal DFA recognizing the empty language has one state. This state is initial but not final. The minimal DFA of its complement, the full language $A^*$ also has only one state, which is both initial and final.

A final remark. In the case of a NFA, not only the set of final states can be empty, but also the set of initial states can be empty.

J.-E. Pin
  • 42,871