Automata Lec#5
Automata Lec#5
FINITE
AUTOMATA
Finite Automata
• Play a board game in which two players move
pieces around different squares.
• Throw dice to determine where to move.
• Players have no choices to make when making
their move. The move is completely determined
by the dice.
• A player wins if after 10 throws of the dice, his
piece ends up on a certain square.
• Note that no skill or choice is involved in the
game.
• Each possible position of pieces on the board is
called a state.
• Every time the dice are thrown, the state changes
according to what came up on the dice.
• We call the winning square a final state (also
known as a halting state, terminal state, or
accepting state).
• There may be more than one final state.
Deterministic Computer
• The computer is deterministic, i.e., on reading
one particular input instruction, the machine
converts itself from one given state to some
particular other state (which is possibly the
same), where the resultant state is completely
determined by the prior state and the input
instruction.
• No choice is involved.
Finite Automata (FA)
• A finite automaton:
– “Finite" because the number of possible states and number
of letters in the alphabet are both finite
– “Automaton" because the change of states is totally
governed by the input.
• It is automatic (involuntary and mechanical) not willful,
just as the motion of the hands of a clock is automatic
while the motion of the hands of a human is
presumably the result of desire and thought.
• "Automaton“ comes to us from the Greek, so its correct
plural is "automata."
FA: Definition
(a + b)*b(a + b)*
The transition table for the FA
Transition Diagram from Transition Table
Paths generated by the input
strings aaaabba and bbaabbbb
Example
The language accepted by this machine is the set of all strings except .
^
This has the regular expression definitions
Example
One of the many FA's that accepts all words is:
Example
• FA's that accept no language. These are of two types:
– FA's that have no final states, such as
OR
a four-state
machine
Example
A five-state machine
Example
Example
• This machine will accept all words with b as the third letter and reject all other
words. The first couple of states are only waiting states eating up the first two
letters of input.
• A word that has fewer than three letters cannot qualify, and its path ends in one of
the three lefthand states, none of which is designated +.
OR
Example
• FA, one that accepts only the word baa.
L = {baa}
Example
• FA accepts exactly the two strings baa and ab.
Example
Example
Example
The language accepted by this machine is all words with an odd number of a's.
Example
This machine will accept the language of all words with a double a in them somewhere.
Example
• FA accepts all words that have different first
and last letters.
• If the word begins with an a, to be accepted it
must end with a b and vice versa.
EVEN-EVEN FA