The transition function

Let g: Q × A -> Q + {fail} denote the transition function of an deterministic finite automaton (A, Q, init, g, T), where A is an input alphabeth, Q is a finite set of states, init is the initial state and T is the set of terminal states.

The value g(q,a) is the state reached from state q by the transition labeled by the input symbol a. We can also say that for the word w, g(q,w) denotes, if it exists, the state reached after reading the word w in the automaton from the state q.

For reasons of economy we allow g to be a partial function.

Example