4

Let's have a language $L=\{\omega\in\{a,b,c\}^* | \omega $ contains $ab$ and does not contain $ba\}$ make a regular expression for this language.

I've ended up with this one $$(a^*(b^*+(cc^{*}a^*))^*)^*ab(b^*+(cc^{*}a^*))^*$$

Is this correct? Does it generate all words containing $ab$ and not containing $ba$ ?

Noturab
  • 497

1 Answers1

2

This is incorrect. It accepts $bab=(a^0(b^1)^1)^1ab$. In the first part of the expression, you want to tie $b$ up to $c$, not $a$ to $c$.

dfeuer
  • 9,069