Finite Automata MCQ Quiz - Objective Question with Answer for Finite Automata - Download Free PDF

Last updated on May 21, 2025

Latest Finite Automata MCQ Objective Questions

Finite Automata Question 1:

Comprehension:

A machine is represented by states Q, input alphabet Σ, transition function δ. Initial state qo and final state F. The machine accepts all the strings over Σ = {a,b}, which starts and ended with any combination of all alphabet and abb works/lies in all the strings to be accepted 

Which of the following represented the minimum state DFA for the above specified passage?

  1. qImage67a74bbcb8840bd62b8ff394
  2. qImage67a74bbcb8840bd62b8ff395

  3. qImage67a74bbdb8840bd62b8ff396
  4. qImage67a74bbdb8840bd62b8ff397

Answer (Detailed Solution Below)

Option 1 : qImage67a74bbcb8840bd62b8ff394

Finite Automata Question 1 Detailed Solution

The correct answer is: Option 1

Key Points

To detect “abb”, we need at least 4 states:

  1. q0 — Start state
  2. q1 — After seeing 'a'
  3. q2 — After seeing 'ab'
  4. q3 — After seeing 'abb' → Accepting

We also need a dead state to trap wrong transitions. So the **minimum** DFA needs at least 5 states.

Option 1: This DFA uses 5 states correctly and has transitions:

  • q1 → q2 (on a)
  • q2 → q3 (on b)
  • q3 → q4 (on b) → final
  • Final state loops on a, b
This is a proper minimal DFA. Correct ✔

 

Option 2: Incorrect transitions. Accepts some but not all “abb” variants. Incorrect

Option 3: Uses 6 states, which is not optimal/minimal. Incorrect

Finite Automata Question 2:

Comprehension:

A machine is represented by states Q, input alphabet Σ, transition function δ. Initial state qo and final state F. The machine accepts all the strings over Σ = {a,b}, which starts and ended with any combination of all alphabet and abb works/lies in all the strings to be accepted 

For the above specified passage, which of the following represent the grammar for the language accepted the machine?

  1. S → AabbB, A → aA|∈, B → bB|∈
  2. S → abbA, A → aA|∈|bA
  3. S → AabbA, A → aA|bA|∈
  4. S → Aabb, A → aA|bA|∈

Answer (Detailed Solution Below)

Option 3 : S → AabbA, A → aA|bA|∈

Finite Automata Question 2 Detailed Solution

The correct answer is Option 3.

key-point-image Key Points
  • Option 3 specifies the grammar for the language accepted by the machine as follows:
    • S → AabbA
    • A → aA | bA | ε
  • This grammar generates strings where:
    • The start symbol S derives a string with 'A', followed by 'aabb', followed by 'A'.
    • The non-terminal A can be replaced by 'aA', 'bA', or ε (the empty string).
  • This allows for the generation of strings with 'a' and 'b' characters appropriately placed in the structure defined by the grammar.
additional-information-image Additional Information
  • Grammar rules (productions) define how strings in a language can be generated from the start symbol.
  • The symbol 'ε' denotes the empty string, which means a non-terminal can be replaced by nothing.
  • The use of non-terminals like A allows for recursive definitions, enabling the generation of complex strings.
  • Correct grammar formulations are essential in parsing and generating strings in programming languages and compilers.

Finite Automata Question 3:

Comprehension:

A machine is represented by states Q, input alphabet Σ, transition function δ. Initial state qo and final state F. The machine accepts all the strings over Σ = {a,b}, which starts and ended with any combination of all alphabet and abb works/lies in all the strings to be accepted 

For the above mentioned passage which of the following is correct?

  1. qImage67a74bbab8840bd62b8ff38d
  2. qImage67a74bbbb8840bd62b8ff38e
  3. qImage67a74bbbb8840bd62b8ff38f
  4. qImage67a74bbcb8840bd62b8ff391

Answer (Detailed Solution Below)

Option 3 : qImage67a74bbbb8840bd62b8ff38f

Finite Automata Question 3 Detailed Solution

- www.bijoux-oeil-de-tigre.com

The correct answer is Option 3.

Key Points

Option 1: The DFA transitions a → b → b directly to final state. But it lacks proper looping logic to verify intermediate characters. No trap state. Incorrect.

Option 2: Accepts strings only if they end with “abb”. But the question states the string can have “abb” anywhere. Incorrect.

Option 3: The DFA clearly detects “abb” and loops over further inputs. So, even strings like “aabb”, “baabbab”, “abba” will be accepted. Correct ✔

Finite Automata Question 4:

Comprehension:

A machine is represented by states Q, input alphabet Σ, transition function δ. Initial state qo and final state F. The machine accepts all the strings over Σ = {a,b}, which starts and ended with any combination of all alphabet and abb works/lies in all the strings to be accepted 

For the above specified passage, which of the following represents the regular expression?

  1. (a + b)* aab
  2. aba(a + b)*
  3. b(a + b)* b(a + b)* a(a + b)*
  4. (a + b)* abb(a + b)*

Answer (Detailed Solution Below)

Option 4 : (a + b)* abb(a + b)*

Finite Automata Question 4 Detailed Solution

The correct answer is (a + b)* abb(a + b)*.

key-point-image Key Points

  • The given regular expression (a + b)* abb(a + b)* matches any string that has "abb" in between any combination of 'a' and 'b' characters.
    • The part (a + b)* indicates any combination (including none) of 'a' and 'b' characters before "abb".
    • The part abb is the fixed substring that must appear in the string.
    • The part (a + b)* after "abb" indicates any combination (including none) of 'a' and 'b' characters after "abb".
  • This regular expression ensures that "abb" is always present in the string, surrounded by any number of 'a' and 'b' characters.

additional-information-image Additional Information

  • Regular expressions are powerful tools used for pattern matching and string manipulation.
  • They are widely used in various programming languages and tools for searching, replacing, and validating text.
  • Understanding the components and structure of regular expressions is essential for effectively utilizing them in different applications.
  • Common operations using regular expressions include searching for specific patterns, validating input data, and parsing text.

Finite Automata Question 5:

Comprehension:

A machine is represented by states Q, input alphabet Σ, transition function δ. Initial state qo and final state F. The machine accepts all the strings over Σ = {a,b}, which starts and ended with any combination of all alphabet and abb works/lies in all the strings to be accepted 

For the above specified passage, which of the following is DFA for the language represented/accepeted by machine?

  1. qImage67a74bb8b8840bd62b8ff387
  2. qImage67a74bb9b8840bd62b8ff388
  3. qImage67a74bbab8840bd62b8ff389
  4. qImage67a74bbab8840bd62b8ff38a

Answer (Detailed Solution Below)

Option 3 : qImage67a74bbab8840bd62b8ff389

Finite Automata Question 5 Detailed Solution

The correct answer is : Option 3

Key Points

Option 1: This DFA starts with state 1 looping on a and b. Then from 1 --a--> 2, 2 --b--> 3, and 3 --b--> 4. After reaching state 4, it loops on a and b and accepts. Looks promising, but lacks rejection for incorrect sequences like “aba”. It accepts too many patterns and has no trap state to reject wrong combinations. Incorrect.

Option 2: This DFA takes a → b → a → b → final. This structure doesn’t track “abb” correctly; it adds unnecessary transitions and doesn’t form the required substring properly. Incorrect.

Option 3: This DFA clearly implements the pattern detection:

  • q1 --a--> q2
  • q2 --b--> q3
  • q3 --b--> q4 (final)
  • q4 is the accepting state, loops on all inputs (a, b)
  • Other transitions (like wrong 'a' or 'b') push to dead states
This structure correctly captures the presence of “abb” as a substring.
Correct Answer ✔

 

Top Finite Automata MCQ Objective Questions

The minimum possible number of states of a deterministic finite automation that accepts the regular language L = {w1aw2 | w1, w2 ϵ {a, b}*, |w1| = 2, |w2| ≥ 3} is ________.

Answer (Detailed Solution Below) 8

Finite Automata Question 6 Detailed Solution

Download Solution PDF

Given language is:  L = {w1aw2 | w1, w2 ϵ {a, b}*, |w1| = 2, |w2| ≥ 3}

Regular expression: (a+b) (a+b) a (a+b) (a+b) (a+b)(a+b)*

Minimum length string that is possible = (a+b) (a+b) a (a+b) (a+b) (a+b)

This string has minimum length 6. For these 7 states are needed and one trap state. So, total 8 states are needed.

DFA for given language is

F1 R.S 12.12.19 Pallavi D 1

F1 R.S Deepak 30.12.2019 D 2

F1 R.S Deepak 30.12.2019 D 3

Consider the DFAs M and N given above. The number of states in a minimal DFA that accepts the language L(M) ∩ L(N) is____________________

Answer (Detailed Solution Below) 1

Finite Automata Question 7 Detailed Solution

Download Solution PDF

Consider DFA M,

It is accepting all the string that ends with a.

Language for DFA M L(M) = {a, aa, ba, aaa, aba, …}

Regular expression = (a + b )*a

DFA N is accepting all the languages ending with b.

Language for DFA N L (n) = {b, ab, bb, aab, abb, bbb,…….}

Regular expression = (a + b)*b

Intersection of both these languages L (M) ꓵ L(N) = { } = Ø i.e. empty language

For this, we just need 1 state with all transitions to itself and no final state.

F1 R.S Madhu 14.01.20 D3

Consider the language L given by the regular expression (a + b)* b (a + b) over the alphabet {a, b}. The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting L is ________.

Answer (Detailed Solution Below) 4

Finite Automata Question 8 Detailed Solution

Download Solution PDF

Concept:

First convert the given regular expression into an NFA and then find out the DFA from NFA.

Explanation: 

Regular expression is (a + b) * b (a + b)

NFA for this expression is given here as:

Diagram: NFA

F1 R.S Madhu 4.12.19 D 4

NFA Table:

States

a

b

→ q0

q0

{q0, q1}

q1

q2

q2

q2

ϕ

ϕ

 

DFA Table from the above NFA

States

a

b

→ q0

q0

{q0, q1}

{q0, q1}

{q0, q2}

{q0, q1, q2}

*{q0, q2}

q0

{q0, q1}

*{q0, q1, q2}

{q0, q2}

{q0, q1, q2}

 

Diagram: DFA

F1 R.S Madhu 4.12.19 D 5

This DFA can’t be minimized further. So, for the given regular expression minimum number of states in the DFA is 4.

Let δ denote the transition function and \(\hat \delta\) denote the extended transition function of the ϵ-NFA whose transition table is given below:

δ

ϵ

a

b

→ q0

{q2}

{q1}

{q0}

q1

{q2}

{q2}

{q3}

q2

{q0}

ϕ

ϕ

*q3

ϕ

ϕ

{q2}

 

Then \(\hat \delta \;\left( {{q_2},\;aba} \right)\) is

  1. ϕ
  2. {q0, q1, q3}
  3. {q0, q1, q2}
  4. {q0, q2, q3}

Answer (Detailed Solution Below)

Option 3 : {q0, q1, q2}

Finite Automata Question 9 Detailed Solution

Download Solution PDF

Concept:

Extended transition function means when we start from a state and follow a sequence of input.

In case of ϵ-NFA, epsilon moves are also considered.

Diagram: NFA for the given NFA table is:

F1 R.S 12.12.19 Pallavi D 4

Here, \(\hat \delta \;\left( {{q_2},\;aba} \right)\) 

Explanation:

When input a is applied on q2 it will move to q0, q1 as there is null transition so it will also get to q2.

Similarly, states after input b => {q0, q2, q3}

States after input a = {q0, q1, q2}

So, final answer is {q0, q1, q2}

Two finite state machines are said to be equivalent if they:

  1. Have the same number of edges
  2. Have the same number of states
  3. Recognize the same set of tokens
  4. Have the same number of states and edges

Answer (Detailed Solution Below)

Option 3 : Recognize the same set of tokens

Finite Automata Question 10 Detailed Solution

Download Solution PDF

Concept:

Finite state automata is a machine that can be used to solve computer programs and other sequential logics and have finite number of states at a given time. There are 6 tuples in a finite state machine.

Explanation:

Two finite state machines are said to be equivalent if they recognize the same set of tokens.

Consider two automata M1 and M2, these are called equivalent for an input sequence if they produce the same output result.

Example:

Regular expression: baa*b

NFA: M1

TOC

Number of states in NFA: 4

DFA: M2

DFA

Number of states in DFA: 5

Above two finite automata are having different number of states and edges, but they are equivalent.

They are said to be equivalent only when they accept same regular language (same set of tokens) whether they have different number of states or edges.

Let be an NFA with n states. Let k be the number of states of a minimal DFA which is equivalent to N. Which one of the following is necessarily true?

  1. k ≥ 2n
  2. k ≥ n
  3. k ≤ n2
  4. k ≤ 2n

Answer (Detailed Solution Below)

Option 4 : k ≤ 2n

Finite Automata Question 11 Detailed Solution

Download Solution PDF
A state in a DFA will be a subset of the set of states of the equivalent NFA. So, the maximum number of states in the equivalent DFA of an NFA, will be 2n, where n is the number of states in NFA, as a set with n items has maximum 2n subsets. 

The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

  1. Finite state automata
  2. Deterministic pushdown automata
  3. Non-deterministic pushdown automata
  4. Turing machine

Answer (Detailed Solution Below)

Option 1 : Finite state automata

Finite Automata Question 12 Detailed Solution

Download Solution PDF

The correct answer is option 1

Finite Automata(FA):

  • The first phase of the compiler is called lexical analysis or scanning. The lexical analyzer reads the stream of characters making up the source program and groups the characters into a meaningful sequence called lexemes.
  •  For each lexeme, the lexical analyzer produces tokens as output for the parser and tokens are expressed in regular expressions

So, a simple Finite Automata is sufficient for it

Phases in a compiler:

F1 R.S NIta 07.10.2019 D 1

Additional Information

Compiler Phase

Machine Model Required

Lexical Analysis Phase

Finite Automata

Syntax Analysis Phase

Push Down Automata

Semantic Analysis Phase

Turing Machine(TM)

Number of states in DFA accepting the following language is:

L = { an b2m | n, m ≥ 1 }

  1. n
  2. 5
  3. m
  4. 2

Answer (Detailed Solution Below)

Option 2 : 5

Finite Automata Question 13 Detailed Solution

Download Solution PDF

Data

Language L = { an b2m | n, m ≥ 1 }

Concept

It is easier to find the minimized DFA if we find the NFA first.

NFA of the given language.

F1 R.S 21.5.20 Pallavi D2

Converting this NFA into minimized DFA

Transition table

State

Input a

Input b

1

2

Dead state

2

2

3

3

Dead state

4

4

Dead state

3

Dead state

Dead state

Dead state

 

Hence, number of states in DFA for the language L = { an b2m | n, m ≥ 1 } is 5.

F1 R.S 21.5.20 Pallavi D3

Minimum number of states required in DFA accepting binary strings not ending in “101” is

  1. 3
  2. 4
  3. 5
  4. 6

Answer (Detailed Solution Below)

Option 2 : 4

Finite Automata Question 14 Detailed Solution

Download Solution PDF

Binary strings not ending in 101 is a set that is complement to binary strings ending in 101.

Since, regular languages are closed under complement, we can first design a DFA that accept strings that surely end in 101.

For finding the complement of this DFA, we simple change the non-final states to final and final state to non-final keeping the initial state as it is.

Hence, 4 states will be required.

The number of states in the minimum sized DFA that accepts the language defined by the regular expression 

(0 + 1)*(0 + 1)(0 + 1)*

is ______.

Answer (Detailed Solution Below) 2

Finite Automata Question 15 Detailed Solution

Download Solution PDF

Given regular expression: (0 + 1)*(0 + 1)(0 + 1)*

In this, there is atleast one appearance of (0 + 1).

It generates strings of type {0, 1, 00, 01, 10, 11, 000, 001, 011, ……. }

DFA for the given expression is:

F1 R.S 24.12.19 Pallavi D 2

Number of states in minimum sized DFA for this regular expression = 2

Get Free Access Now
Hot Links: teen patti 3a teen patti list teen patti gold new version