Open In App

GATE | Quiz for Sudo GATE 2021 | Question 44

Like Article
Like
Save
Share
Report

A regular expression is ambiguous when there exists a string which can be constructed in two different ways from the regular expression. Which of the following regular expression(s) are ambiguous?

Note – This question is multiple select questions (MSQ).
(A) a((ab)*cd)* ∪ a(ababcb*)*a*
(B) aab*(ab)* ∪ ab* ∪ a*bba*
(C) aaba* ∪ aaaba ∪ aabba* ∪ a
(D) None of these


Answer: (A) (B)

Explanation: (A) Ambiguous. For instance, the string a can be constructed by using a((ab)*cd)* or a(ababcb*)*a*.
(B) Ambiguous. The string abb can be constructed either by ab* or a*bba*.
(C) Unambiguous.

Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 18 Dec, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads