3,604 views
0 votes
0 votes
Find the regular expression

No 2 a's and 2 b's should come together?

4 Answers

1 votes
1 votes

No two a's and b's should come together..so language is L=(Epsilon+b)(ab)* (a+Epsilon).

L={Epsilon, b, a, ab,abab,....,bab,babab,....aba,ababa,....}

0 votes
0 votes
(a+€) (ba) * (b+€) + a+b+ab+€

Explanation :

The only possible strings is a followed by b and b followed by a tht is  bababa.....  

So we get (ba) *

But strings could also start with a and could also end with b

So we add (€+a) and (b+€) at the start and the end

But the minimum possible string in our regular expression is ba which means we have left some strings

So we add ab+a+b+€ in the end to cover all possible strings
0 votes
0 votes
alphabets= { a , b }


L={ epsilon , a , b , ab , ba , aba , bab , abab ,...........................} it's infinite language
It may have these two answers
1)         (epsilon+b)(ab)*(epsilon+a)

or

2)         (epsilon+a)(ba)*(epsilon+b)


Both of them are correct