Practice NFA Conversion 1
Practice NFA Conversion 1
Draw a deterministic and non-deterministic finite automate which accept 00 and 11 at the end
of a string containing 0, 1 in it, e.g., 01010100 but not 000111010.
Solution:
Q: 2
Draw a deterministic and non-deterministic finite automata which accept a string containing
“the” anywhere in a string of {a-z}, e.g., “there” but not “those ”.
Q: 3 Draw a deterministic and non-deterministic finite automata which accept a string
containing “ing” at the end of a string in a string of {a-z}, e.g., “anything” but not “anywhere”.
Q. 4 Construct an NFA that will accept strings over alphabet {1, 2, 3} such that the last symbol
appears at least twice, but without any intervening higher symbol, in between: – e.g., 11, 2112,
123113, 3212113, etc.
Q6: Find the DFA equivalent to the given NFA whose transition table is given below:
Solution
Firstly, we construct the transition table of DFA from the transition table of NFA.
The first row of the transition table will be the same as the NFA transition table.
We stop these steps when there are no more states under the input columns. Now we will mark
the initial and final states of DFA. In NFA, we have D as the final state. So, in DFA, every state
where D appears will be the final state. And the first row [A] of the transition table of DFA
will be marked as the initial state.
Q7: Convert the following NFA to DFA
Solution
Q 8:
Next State
Present State
0 1
→q0 {q2} Φ
q1 Φ {q0, q2}
Next State
Present State
0 1
→{q0} {q2} Φ