Open In App

Practice problems on finite automata | Set 2

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
11 Likes
Like
Report

A DFA is represented as {Q, Σ, q, F, δ}. In DFA, for each input symbol, the machine transitions to one and only one state. DFA does not allow any null transitions, meaning every state must have a transition defined for every input symbol. NFA is similar to DFA but includes the following features:

  • It can transition to multiple states for the same input.
  • It allows null (ϵ) moves, where the machine can change states without consuming any input.

Que-1: Draw a deterministic and non-deterministic finite automate which either starts with 01 or end with 01 of a string containing 0, 1 in it, e.g., 01010100 but not 000111010.

Explanation :

DFA and NFA of same language whose strings only reach to the final state containing either 01 at start or at the end. If anything else is come then come out to the final state then it does not accept. NFA of the given string is as follows:

Example: 0110,110001,111101,0100000,11010101,0111111...

DFA of the same given string is as follows by converting the given NFA to DFA :Here, q0 shows the initial state, q1, q2 are the transition states, and q3, q4, q5, q6, q7 are the transition and final states.

Que-2: Draw a non-deterministic finite automate which starts with 01 and ends with 01 of a string containing 0, 1 in it, e.g., 01000101 but not 000111001.

Explanation :

NFA of same language whose strings only reach to the final state containing 01 at start and at the end. If anything else is come then come out to the final state then it does not accept. NFA of the given string is as follows:

 Here, q0 shows the initial state, q1, q2, q3 are the transition states, and q4 is the final state.

Que-3: Draw a deterministic finite automata which recognize a string containing binary representation 0, 1 in the form of multiple 2, e.g., 1010 but not 01101.

Explanation :

Draw a DFA whose strings only reach to the final state containing 0 at the end that means number is multiple of 2. If anything else is come then come out to the final state then it does not accept. DFA of the given string is as follows:

Example:00,100,10010,10100,0100010...

Here, q0 shows the initial and final state, q1 is the transition states.

Que-4: Draw a deterministic finite automata which recognize a string containing binary representation 0, 1 in the form of multiple 3, e.g., 1001 but not 1000.

Explanation :

Draw a DFA whose string only reach to the final state containing binary number is multiple of 3. If anything else is come then come out to the final state then it does not accept. DFA of the given string is as follows:

Example :011,0011,01001,1001...

Here, q0 shows the initial and final state, q1, q2 are the transition states.

For more practice on DFA you can refer to Practice problems on finite automata.


Explore