We now switch from a study of languages to a study of machines (automata). Why? You will see!
Finite automata (FA) are most clearly described by pictures (state diagrams):

FA vocabulary:
How does a state diagram behave like a machine?

Here's how it "works":
1. you are given an input string of characters
2. machine "starts" in its start state
3. "read" the first character from the input string
4. delete that character from the string
5. from the current state, take the transition indicated by the input
character, and "move" to the indicated state (if there is no transition,
CRASH and reject the string
6. if the input string is not empty, go back to 3
7. otherwise, if the machine is in a final state, accept the
string. If not, reject it.
Let's see if "aaab" will be accepted:
|
![]() |
We can also encode a FA in tabular (array) format:
| Transition symbol | ||||
| State | a | b | c | d |
| 1 Start | 2 | 3 | 3 | |
| 2 | 2 | 4 | 4 | |
| 3 | 3 | 5 | ||
| 4 Final | ||||
| 5 Final | ||||
This suggests one way to program an FA on a computer!
Another example:

("+"+- +l )(1+2+…+9)(0+1+2…+9)*( l +.)(0+1+2…+9)*