Finite Automata - Our first machine model
Our first model of a machine will be based on the assumption
that a fixed, finite amount of memory is available. Now, in
any computer the memory is finite, but the point is that we
effectively treat memory as infinite when we program, and are
quite surprised if anything ever crashes due to insufficient
memory. So, yes, a billion-bit memory is finite, but we don't
usually worry about it. In our model, however, memory is
finite and we're forced to think of it that way ... usually
we'll have 1 bit, 2 bits ... maybe 9 or 10 bits of memory in
our machine, but we're not usually talking millions or
billions.
Introducing the diagram definition for Finite Automata
A
finite automaton is a very simple kind of computer.
It reads its input as a string of characters from some
alphabet, and as it goes the only "memory" it has of what it's
read is the
state it's in. The machine consists of a finite
number of states, and it simply changes from state-to-state as
it reads input.
One state is labelled as the "start" or "initial" state which,
not surprisingly, is the state you start off in.
Some states are labelled as
accepting, and when the input is exhausted, the
machine "accepts" the input string if it happens to have ended
up in an accepting state. The set of strings accepted by
a finite automaton
M is, of course, a language ---
the "language accepted by
M", as we say, or
"
L(M)" for short.
We draw diagrams to represent these machines. The diagrams
are directed graphs whose vertices are the states, and whose
edges are transitions, which are rules to tell you
which states to move to as you read characters.
If an edge (i.e. transition) from state p to state q is
labelled with character a, it means that when the machine
is in state p and it reads character a it
goes into state q.
Some examples should make this quite clear:
| Draw a machine accepting the
language {ab,ba} |
Given the machine below, give an English description
of the language it accepts |
Note: This is not the
simplest machine accepting this language! |
Answer: The machine accepts strings consisting
of any number of copies of abc concatenated together.
|