485 views
0 0 votes
Are both regular expression  same .a*(ba*)* =(a+b)*ba(a+b)*

if not then why????

1 Answer

0 0 votes

Both are not equivalent.. 

Because using first regular expression we can generate any string of alphabet a & b. 

But the constraint with second regular expression is that all the string must have ba as its substring..

That's why both are not equivalent!! 

Hope it helps!! 

Please Comment if there is anything wrong in my explanation!! 

Position:
Show:

Related questions

3 3 votes
2 2 answers
290
290 views
GO Classes asked Oct 23, 2025
290 views
Consider the following three regular expressions over the alphabet $\Sigma=\{0,1\}$ :$p=\left(1^* 01^* 0\right)^* 1^*$ $q=\left(0^* 10^* 1\right)^* 0^*$ $r=((0+1)(0+1))^*...
3 3 votes
1 1 answer
317
317 views
GO Classes asked Oct 23, 2025
317 views
Let $\mathrm{p}, \mathrm{q}$, and r be three regular expressions over the alphabet $\Sigma=\{a, b\}$.$p=a(a+b)^* b$ $q=(a+b)^* a b(a+b)^*$ $r=a a^* b b^*$Which of the fol...