UNIT 1 PDF Cis262sl1aut
UNIT 1 PDF Cis262sl1aut
UNIT 1 PDF Cis262sl1aut
51
52 CHAPTER 3. DFA’S, NFA’S, REGULAR LANGUAGES
Start state: 0.
a b
0 1 3
1 3 2
2 1 3
3 3 3
a b
0 1 2
a
a
b b
3
a, b
Start state: 0.
a b
0 1 2
1 2 0
2 2 2
a
0 1
b
b a
2
a, b
Start state: 0.
a b
0 1 0
1 1 2
2 1 3
3 1 0
3.1. DETERMINISTIC FINITE AUTOMATA (DFA’S) 59
b
b a
a b b
0 1 2 3
a
δ ∗(p, ϵ) = p,
δ ∗(p, ua) = δ(δ ∗(p, u), a),
L(D) = {w ∈ Σ∗ | δ ∗(q0, w) ∈ F }.
a b
0 1 0
1 0 1
2 3 0
3 4 0
4 2 0
a b
0 1 0
1 0 1
L(D) ̸= ∅ iff Qr ∩ F ̸= ∅. (∗emptyness)
Start state: 0.
a b
0 {0, 1} {0}
1 ∅ {2}
2 ∅ {3}
3 ∅ ∅
a, b
a b b
0 1 2 3
0 1
b
b
0 2
a a
0 1
b b
0 2
b b
0 3
Thus, all failed paths of type (1) and (2) are ignored.
Furthermore, there is no charge for failed paths.
80 CHAPTER 3. DFA’S, NFA’S, REGULAR LANGUAGES
δ ∗ : Q × Σ∗ → 2Q .
3.4 ϵ-Closure
ϵ-clo0(p) = {p},
ϵ-cloi+1(p) = ϵ-cloi(p) ∪
{q ∈ Q | ∃s ∈ ϵ-cloi(p), q ∈ δ(s, ϵ)}.
82 CHAPTER 3. DFA’S, NFA’S, REGULAR LANGUAGES
|ϵ-cloi+1(p)| ≥ |ϵ-cloi(p)| + 1 ≥ i + 1 + 1 = i + 2,
by proving that
1. ϵ-cloi(p) ⊆ ϵ-closure(p), for all i ≥ 0.
2. ϵ-closure(p)i ⊆ ϵ-cloi0 (p), for all i ≥ 0.
where ϵ-closure(p)i is the set of states reachable from p
by an ϵ-path of length ≤ i.
3.4. ϵ-CLOSURE 85
ϵ-closure(p) = {p}.
with
ϵ-closure(∅) = ∅.
ϵ-closure(S) = S.
δ ∗(p, ϵ) = ϵ-closure({p}),
" ! #
δ ∗(p, ua) = ϵ-closure δ(s, a) .
s∈δ ∗ (p,u)
δ$: 2Q × Σ∗ → 2Q
S = ϵ-closure(S).
90 CHAPTER 3. DFA’S, NFA’S, REGULAR LANGUAGES
∆: Q × Σ → Q
with
∆(∅, a) = ∅.
where F = {S ∈ Q | S ∩ F ̸= ∅}.
3.5. CONVERTING AN NFA INTO A DFA 91
a b
0 {0, 1} {0}
1 ∅ {2}
2 ∅ {3}
3 ∅ ∅
Set of accepting states: F4 = {3}.
a, b
a b b
0 1 2 3
⇒ index states a b
→ A {0}
Just after entering the while loop
index states a b
⇒→ A {0}
After the first round through the while loop.
index states a b
⇒ A {0} B A
→ B {0, 1}
3.5. CONVERTING AN NFA INTO A DFA 95
index states a b
A {0} B A
⇒→ B {0, 1}
After the second round through the while loop.
index states a b
A {0} B A
⇒ B {0, 1} B C
→ C {0, 2}
After the third round through the while loop.
index states a b
A {0} B A
B {0, 1} B C
⇒ C {0, 2} B D
→ D {0, 3}
96 CHAPTER 3. DFA’S, NFA’S, REGULAR LANGUAGES
index states a b
A {0} B A
B {0, 1} B C
C {0, 2} B D
⇒→ D {0, 3} B A
b
b a
a b b
0 1 2 3
a