Professional Documents
Culture Documents
Finite Automata With Epsilon-Transitions and With Outputs
Finite Automata With Epsilon-Transitions and With Outputs
Note: For each symbol the resulting set of states will also include the
states for any ε-transitions immediately after that symbol.
ECLOSE(1) = {1, 2, 6} 0 1
ECLOSE(2) = {2}
ECLOSE(3) = {3, 4} *{1, 2, 6} Ф [3, 4} 0, 1
ECLOSE(4) = {4} [3, 4} {2, 5, 6} Ф 0
ECLOSE(5) = {2, 5, 6} Ф {2, 5, 6}
ECLOSE(6) = {6} *{2, 5, 6} Ф [3, 4}
Ф Ф Ф 0 0 1
1
Start
{1, 2, 6} {3, 4}
1
Khawaja 2023 Automata Theory & Languages 11
Converting ε-NFA to DFA – Example 2
ε-NFA that accepts decimal numbers
ECLOSE(q0) = {q0, q1}
ECLOSE(q1) = {q1}
ECLOSE(q2) = {q2}
ECLOSE(q3) = {q3, q5}
ECLOSE(q4) = {q4}
ECLOSE(q5) = {q5}
+, - . 0,1,…,9
{q0, q1} {q1} {q2} {q1, q4}
[q1} Ф {q2} {q1, q4}
{q2} Ф Ф {q3, q5}
{q1, q4} Ф {q2, q3, q5} {q1, q4}
*{q3, q5} Ф Ф {q3, q5}
*{q2, q3, q5} Ф Ф {q3, q5}
Khawaja 2023 Automata Theory & Languages 12
DFA with Output
(Moore and Mealy Machines)
1 1 0
a b a b
For example, for input abab: q0 q1 q2 q1 q2
0 0 1 0 1
Khawaja 2023 Automata Theory & Languages 16
Mealy Machine
Σ = {a, b} a/1 b/0
O = {0, 1}
b/0
Start
q0 q1
a/1
Output is determined by the state and the input:
λ:QxΣO
(q0 , a) 1
(q0 , b) 0
(q1 , a) 1
(q1 , b) 0