0

I want to write a regular expression that generates precisely those words over $\Sigma = \{a,b\}$ that contain at most 1 non-overlapping occurrences of the subword bba. It has to accept the empty word and words suchs as $a$ or $bb$ or $aaaaaabbabbbb$.

So far I've tried to place $bba$ in the beginning, middle or end. But the thing is that the options seem as good as endless when thinking of words it should contain and I can keep on adding options.

I've tried things like $a^*b^*(ba)^*(bba)^*a^*b^*(ba)^*(bba)^*a^*b^*(ba)^*(bba)^*$ but I can just keep on adding $a^*b^*(ba)^*$ to create more options. I'm going wrong somewhere. Could you please help?

emiserry
  • 1
  • 1

0 Answers0