A simple kind of automaton. The input string is read once from left to right, looking at each symbol in turn. At any time the FSA is in one of finitely many internal states; the state changes after each input symbol is read. The new state depends on the symbol just read and on the current state. An FSA is therefore determined by a function f
where
I is the set of possible input symbols,
Q is the set of states, and
I ×
Q is the Cartesian product of
I and
Q.
Q must be finite.
The function f is called a state-transition function. It is commonly represented either by a table or by a directed graph, known respectively as a state-transition table and a state-transition diagram. The figure shows two equivalent representations in which
In this example,
f extends to strings in the obvious manner: in the example,
Let
Q be divided into
accepting states and
rejecting states, and let
q0 be some member of
Q (referred to as the
start state). The
language recognized by the FSA is the set of all
w such that
is an accepting state, i.e. the set of all strings that take the start state to an accepting state. For example, in the FSA shown in the figure let
q0 be 1 and let 4 be the only accepting state; the language recognized is then the set of all strings over {
a,
b,
c} that somewhere contain
abc as a substring. A language recognized by an FSA is known as a regular language.
A generalization is to allow more than one state to which the FSA can move, for a given input symbol and current state. This gives a nondeterministic FSA. The input string is then accepted if there is some sequence of choices of moves leading to an accepting state. Such a machine can always be converted to a deterministic one recognizing the same language.
See also minimal machine, sequential machine.