Chapter 2: Finite Automata
Chapter 2: Finite Automata
Chapter 2: Finite Automata
Peter Cappello
Department of Computer Science
University of California, Santa Barbara
Santa Barbara, CA 93106
[email protected]
1
2.2 Nondeterministic Finite Acceptors
2
Transition graphs for NFAs are suitably modified:
• If
δ(q, a) = {s1 , s2, . . . , sk },
where each si ∈ Q, then there is an arc labelled a (including λ) from
the node labelled q to each of the nodes labelled s1, s2, . . . , sk .
Figure 1: An NFA
3
Defn. 2.5 For an NFA, the extended transition function is defined
so that δ ∗(q, w) contains q 0 ⇔ there is a path in the TG from q to q 0
labelled w, ∀q, q 0 ∈ Q, w ∈ Σ∗.
For the NFA given in Fig. 3, what is:
• δ ∗(q0 , a)?
• δ ∗(q1 , λ)?
• δ ∗(q1 , a)?
• δ ∗(q2 , a)?
• δ ∗(q0 , b)?
4
Defn. 2.6 The language L(M ) accepted by NFA M = (Q, Σ, δ, q0, F )
is
{w ∈ Σ∗ : δ ∗(q0, w) ∩ F 6= ∅}.
Why Nondeterminism?
Although many reasons may be put forth, 1 reason is that choices are
represented by nondeterminism succinctly.
For example, given NFA M1 and NFA M2, construct an NFA M3 such
that L(M3) = L(M1) ∪ L(M2).