Which one of the following regular expressions does not define the language of all strings that ends with a.
- $(a + b)^*a$
- $b^*aa^*(bb^*aa^*)^*$
- $[a(ba)^* + b(ab)^*](a + b)^*a$
- $(b + aa^*b)^*a(a + bb^*a)^*$
So I thought the easiest way off solving this is taking a short string that is not obviously in all of them $bba$ and testing the expressions against that.
While typing this out I think I see the answer that eluded me on pen and paper, it looks like 4 cannot generate the string $bba$, is that correct?
(3) is the only regular expression not defining the language of all words that ends with $a$. Indeed the word $a$ is not matched by this expression.
The three other expressions define what you want.