744 views
1 votes
1 votes

Q. 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
(c) 4
(b) 3
(d) None


Solution: Option (d)


Explanation:
The shortest string is ε generated by both the regular expressions

I believe the above explanation is wrong as (i) will generate at least 'b'.

Please correct me if I'm wrong.

1 Answer

2 votes
2 votes

@Akash Mishra...i think u r right....

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

:_) for the first RE....smallest string is  'b' which is also present in second RE....

hence ...answer i.e (length of smallest string present in both should be '1' ....which is not in the option hence 

option D

Related questions

0 votes
0 votes
1 answer
4
M_Umair_Khan42900 asked Dec 29, 2022
787 views
Show that the following pairs of regular expressions define the same language over the alphabet I = [a, b].s(a) p(pp)*( A + p)q + q and p*q(b) A +0(0+1)* + (0+1)* 00(0+1)...