3. CPCS 302 ch3
Conversion of NFA to DFA
❑ Subset construction algorithm
▪ Input: An NFA N
▪ Output: A DFA D accepting the same language as N
▪ Algorithm: construct a transition table Dtran corresponding to D
3
4. CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
2/9/2019 4
5. CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
2/9/2019 4
6. CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
o ε - closure(0) = { 0, 1, 2, 4, 7}
2/9/2019 4
7. CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
o ε - closure(0) = { 0, 1, 2, 4, 7}
• Add to Dtrans table
2/9/2019 4
NFA State a b
{0,1, 2, 4, 7}
8. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
9. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
10. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
{3, 8}
11. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8}
12. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8}
13. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
14. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
o Add set to Dtrans table:
• for symbol a
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
15. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
o Add set to Dtrans table:
• for symbol a
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
16. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
17. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
18. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
{5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
19. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
20. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
21. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
22. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
23. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
24. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
25. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
26. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
27. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
28. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
29. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
30. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
31. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
32. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
33. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
34. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
35. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
36. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
37. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
38. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
39. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
40. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) =
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
41. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) =
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
42. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
43. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
44. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
ε - closure for symbol
a need not be
computed ➔ all have
same set of states
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
45. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
46. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
47. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
48. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) ={5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
49. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) ={5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
50. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
51. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
52. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
53. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
54. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
55. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
56. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
57. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
58. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = {3, 6, 1,2, 4, 7, 8}{3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
59. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
60. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
61. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
62. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) ={5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
63. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) ={5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
64. Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) = { 5, 6, 7, 1, 2, 4, 10 }{5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
79. Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
80. Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
81. Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
82. Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
E
A
a B
C
b
a
D
b
a
b
a
b
a
b
Start
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
DFA
83. Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
E
A
a B
C
b
a
D
b
a
b
a
b
a
b
Start
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
DFA NFA
84. CPCS 302 ch3
Conversion of NFA to DFA
❑ Subset construction algorithm
▪ Input: An NFA N
▪ Output: A DFA D accepting the same language as N
▪ Algorithm: construct a transition table Dtran corresponding to D
2/9/2019 16