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 Σ, transition function δ, initial state q0 and final states F. The machine accepts all strings over Σ = {a, b} which start and end with any combination of the alphabet symbols, and in which abb occurs as a substring (i.e. the language of all strings over {a, b} containing abb).

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

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

Show answer & explanation

Correct answer: D. (a + b)* abb (a + b)*

Explanation

Strings containing abb as a substring: anything, then abb, then anything = (a + b)* abb (a + b)*.

More Theory of Computation and Compilers questions