edited by
9,600 views
1 votes
1 votes

Consider following Regular Expression

(i) a*b*b (a+ (ab)*)* b*

(ii) a*(ab + ba)* b*

What is length of shortest string which is in both (i) & (ii)?

A. 2 B. 3 C. 4 D. None

edited by

2 Answers

Best answer
7 votes
7 votes
(i) a*b*b (a+ (ab)*)* b* = a*b*b (a+ ab)* b*

(ii) a*(ab + ba)* b*

Shortest string will be "b" only..

Length will be 1.

Option D.
selected by
1 votes
1 votes
b is the smallest string derived by both languages.

hence answer is  min length =1

Option D

Related questions