HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Finite state automata: final states

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
finitestatesautomatafinalstate

Problem

In our programming language concepts course, our instructor claimed that it's okay for a final state to lead to another state in a finite state diagram.

But this seems to be a fundamentally contradictory concept. Because a final state by definition is one that terminates transitions, i.e., that once you reach it, there's nothing else left to do.

And yet he presented a slide such as this one, where final states are represented by two circles... How is it possible for B, D, E, and H to be final states when they're so clearly not?

Solution

You seem to have a misunderstanding of generative models v.s. "recognizing" models.

The grammar you have on the right generates words by applying rules, starting from the initial variable, and stopping after there are no more variables.

Automata, however, recognize a language as follows: you feed the automaton a word, letter by letter, and the automaton takes transitions based on the letters given to it.

If, after reading all the letters, the automaton ends up in an accepting (a.k.a final) state, then we say that the automaton accepts the word.

So it's better to think of those as "accepting" states, rather than "final" states, although both terms are commonly used.

Context

StackExchange Computer Science Q#92720, answer score: 17

Revisions (0)

No revisions yet.