All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2024

Directions (Q91–95): A machine is represented by states Q, input alphabet Σ = {a, b}, a transition function δ, initial state q0 and final states F. It accepts all strings over Σ that contain abb as a substring, with any combination of a and b before and after it.

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

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C.

Option C

Explanation

The language is (a+b)*abb(a+b)*. The NFA in C loops on a, b at the start, reads a, b, b in sequence, and loops on a, b in the final state — exactly that language.

More Theory of Computation and Compilers questions