Sei sulla pagina 1di 3

A deterministic finite automaton will have a single possible output for a given input.

The answer is deterministic because you can always tell what the output will be.

A nondeterministic finite automaton will have at least one input which will cause a
"choice" to be made during a state transition. Unlike a DFA, one input can cause
multiple outputs for a given NFA.

72 CHAPTER 5. FINITE AUTOMATA


Deterministic Finite Automata
Initialization
² The state of the machine is set to the initial state, q0.
² The input string is written on the semi-in¯nite tape with
its ¯rst symbol
writen in the ¯rst cell of the tape. All other cells are
considered blank.
² The read head is positioned over the ¯rst cell of the
tape, which is the ¯rst
symbol of the input string.
Transitions depend on
² The current state.
² The symbol under the read head.
What happens at each step
² The control unit advances to one of a ¯nite number of
states.
² The read head moves exactly one cell to the right.
Halts when
² The read head moves onto a blank cell of the tape.
Formal De¯nition of a Deterministic Finite Automaton
as a 5-tuple: (§; Q; q0; A; ±)
Symbol Name Description
§ Input alphabet Finite non-empty set for encoding input
strings.
Q State set Finite non-empty set of state labels.
q0 Initial state The machine starts in this special state of
Q.
A Accept states The machine accepts the string if it halts
in one of these states.
± Transition function A function from Q £ § to Q.
(a) All strings in §¤ that begin with aa or end with bb (or
both).
(b) All strings in §¤ that do not contain the substring aba.
(c) All strings in §¤ with an even number of a's.
(d) All strings in §¤ that contain no runs longer than two.
2. Construct a DFA or NFA that accepts each of the
following languages over the alphabet
§ = fa; b; cg. You need only exhibit the state diagrams,
but indicate whether it is a DFA or an
5.7. EXERCISES 73
Nondeterministic Finite Automata
Initialization
² Exactly the same as a DFA.
Transitions depend on
² The current state.
² Zero or more contiguous symbols, starting with the one
under the read head
and moving to the right.
² A nondeterministic choice among available alternatives.
What happens at each step
² The control unit advances to one of a ¯nite number of
states.
² The read head moves zero or more cells to the right.
Halts when
² The read head moves onto a blank cell of the tape.
² An unde¯ned transition is encountered.
Formal De¯nition of a Nondeterministic Finite Automaton
as a 5-tuple: (§; Q; q0; A; ¢)
Symbol Name Description
§ Input alphabet Finite non-empty set for encoding input
strings.
Q State set Finite non-empty set of state labels.
q0 Initial state The machine starts in this special state of
Q.
A Accept states
The machine accepts the string if some sequence of
nondetermin-
istic choices allows the machine to halt (by reaching the
end of the
string) in one of these states.
¢ Transition relation A ¯nite subset of Q £ §¤ £ Q
NFA, and explain why it is one or the other. (We shall
always regard a machine as a DFA if it

Potrebbero piacerti anche