Consider the regular expression R = (a + b)* (aa + bb) (a + b)*<br> Which of…

2007

Consider the regular expression R = (a + b)* (aa + bb) (a + b)*<br>

Which of the following non-deterministic finite automata recognizes the language defined by the regular expression R? Edges labeled λ denote transitions on the empty string.

2007_71

  1. A.

    A

  2. B.

    B

  3. C.

    C

  4. D.

    D

Attempted by 37 students.

Show answer & explanation

Correct answer: A

The regular expression R = (a + b)* (aa + bb) (a + b)* describes the set of all strings over {a, b} that contain at least one occurrence of 'aa' or 'bb'. The correct NFA must accept any string that includes either 'aa' or 'bb' as a substring, regardless of what comes before or after. It must reject strings that do not contain 'aa' or 'bb'.

Explore the full course: Gate Guidance By Sanchit Sir