[Math] Final state of a Finite automaton.

finite-automataformal-languages

  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?

Best Answer

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.