Formal definitions
As shown in Sipser, a finite automaton is a tuple, consisting of a set of states, an alphabet, a transition function, a starting state, and a set of accept states.
There are some restrictions:
Q and \Sigma must be finite sets. We can’t have a infinite set of states or an infinite alphabet.
F, the set of accept states must be a subset of Q, that is F \subseteq Q. While it’s not prohibited for F to equal Q, any machine with such an F would be rather boring. (Why?)
The start state q_1 must be an element of Q. (This, of course, implies that Q is non-empty.)
The transition function \delta, must have Q \times \Sigma as its domain, and Q as its range. That is \delta: Q \times \Sigma \rightarrow Q. It is also the case that each element of the Cartesian product Q \times \Sigma must have a corresponding transition defined. Thinking in terms of inputs and outputs, each piece of this piecewise function takes a tuple of a state and a symbol as its input, and returns a state.
Writing the transition function
\delta is a piecewise function. So for, example, with the machine defined in Sipser, Figure 1.6, with Q = \{q_1, q_2, q_3\} and \Sigma = \{0, 1\}, we have:
\delta = \begin{cases} q_1 & (q_1, 0) \\ q_2 & (q_1, 1) \\ q_3 & (q_2, 0) \\ q_2 & (q_2, 1) \\ q_2 & (q_3, 0) \\ q_2 & (q_3, 1) \end{cases}
It’s often convenient to write this as a table (which is Sipser’s preferred notation), but writing as a table and writing by pieces of a piecewise function are equivalent.
±á±ð°ù±ð’s \delta, from above, written as a table:
0 | 1 | |
---|---|---|
q_1 | q_1 | q_2 |
q_2 | q_3 | q_2 |
q_3 | q_2 | q_2 |
The input states are on the vertical axis; the symbols are on the horizontal axis. You should be comfortable with either notation.
Notice that we have six possibilities in each. This is because, in this instance, the cardinality of the Cartesian product of the set of states and the alphabet equals six.
\lvert Q \times \Sigma \rvert = \lvert Q \rvert \times \lvert \Sigma \rvert = 3 \times 2 = 6.
Copyright © 2023 Clayton Cafiero