Build regular expression from language

684 Views Asked by At

I have the following language: L = {w $\in$ {a,b}* | aa is not part of w}. I have to construct a regular grammar from this language and I thought about first finding the regular expression from the language. I am not sure if my solution is a good one, so I thought about asking here.

The regular expression I found is: (b*abb*)*. Is this a good one?

Thank you in advance.

1

There are 1 best solutions below

1
On

While looking for a regular expression for $L$ is a valid approach, since you ultimately want a regular grammar for $L$ an easier way in this case is to first construct a FA for the language (simple enough–one can do it with two states, both final) and use the FA to construct the grammar (even simpler–two variables and five productions).