0% found this document useful (0 votes)
17 views8 pages

Practice NFA Conversion 1

The document contains a series of questions and solutions related to finite automata, including the construction of deterministic (DFA) and non-deterministic finite automata (NFA) for specific string patterns. It covers examples such as accepting strings ending with '00' or '11', containing 'the', and ending with 'ing'. Additionally, it discusses converting an NFA to a DFA and provides transition tables for both types of automata.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

Practice NFA Conversion 1

The document contains a series of questions and solutions related to finite automata, including the construction of deterministic (DFA) and non-deterministic finite automata (NFA) for specific string patterns. It covers examples such as accepting strings ending with '00' or '11', containing 'the', and ending with 'ing'. Additionally, it discusses converting an NFA to a DFA and provides transition tables for both types of automata.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Q1.

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.

Q5: Let us consider the NDFA shown in the figure below.


The state table of the DFA is shown in below.

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:

Figure (1): NFA

Construct the equivalent DFA of the NFA given in figure (1).


Step 1: Transition Table of NFA from Figure (1):

Next State
Present State
0 1

→q0 {q2} Φ

q1 Φ {q0, q2}

q2* {q0, q1} {q0}


Step 2: Transition Table of DFA:

Next State
Present State
0 1

→{q0} {q2} Φ

{q2} {q0, q1} {q0}

{q0, q1} {q2} {q0, q2}

{q0, q2} {q0, q1, q2} {q0}

{q0, q1, q2} {q0, q1, q2} {q0}

DFA of NFA in Figure (1)

You might also like