Automata Theory: Lecture 8, 9
Automata Theory: Lecture 8, 9
Lecture 8, 9
Lecture objective
Nondeterminism & NFA
Do you remember the definition of DFA?
Before to proceed let’s get familiar with a
definition
Extended transition function
δ* (p , abc) = s
What if we’re allowed to have multiple
edges for one symbol from a state?
• And we’ll see later reverse is also possible and very simple
Nondeterminism
• Benefits:
• Easy to construct from RE and vice versa.
• Difficulties:
• It doesn’t represent an explicit algorithm for accepting a language. Because
algorithm is actually a sequence of steps which
• Are determined by input and may not change for single input if algorithm is executed
many times.
Nondeterminism- Handling difficulty
• Computation tree can be used to
visualize possible sequences for a
string.
• Using DFS and backtracking right
path could be searched.
• But practically we’ve to pay in
terms of time complexity.
Input: aaaabaab
NFA with ^ transition
Another variation
δ∗(q, xa) =
δ∗(q0, aab) = ?
δ∗(q0, bab) = ?
δ∗(q0, abababa) = ?
δ∗(q0, aabba) = ?
What about ^ transitions if allowed in NFA?
Of course extended transition function will be changed.
Caring of ^ transition
• ^-closure of a set of states
Final extended transition function for NFA
and definition of acceptance
δ∗(q0, ^) = ?
Lets do some more exercises δ∗(q0, a) = ?
By applying both ^(S) and δ∗ δ∗(q0, ab) = ?
δ∗(q0, aba) = ?
Is DFA = NFA?
Eliminating Nondeterminism
• Causes of Nondeterminism
1. Multiple edges
2. ^ transitions
1. Eliminating ^ transitions
a. If ^ is word in languages then make start state in new model accept state as
well.
b. Eliminate ^ transitions.
c. Introduce new multiple edges.
Eliminating ^ transitions