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.
- A.
A
- B.
B
- C.
C
- 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'.