# Does this regular expression equal this automata?

I just came across an exercise which is to find a regular expression for the following automata, such that the regular expression and the automata generate the same language.

One solution presents the following expression:

$\qquad \displaystyle r_A = a^+b^+(c\mid ca^*b^+)^*$

However, can this be true? I think not, because the all words created from the regular expression will have at least one $b$ in it, whereas the automata accepts words without $b$, such as $aaa$.

• You already gave the answer, the DFA accepts a, but a is not contained in the language described by the RE. – A.Schulz Jul 21 '12 at 13:56
• It's pretty clear that the two are a mismatch, for the reason you give. Is there a reason why you doubt yourself? – Niel de Beaudrap Jul 21 '12 at 14:10
• It's pretty simple indeed. I doubted because it was the officially provided solution in a teaching book. I am going to send the author an e-mail or check the errata if I find them. Thanks! – Erik Jul 21 '12 at 14:26
• I think it should be a+b*(c|ca+b*)* – Erik Jul 21 '12 at 17:56
• Note that this question can be seen as too localized; you should try to formulate a more general question in most cases. Also note that we can use LaTeX here for typesetting maths. – Raphael Jul 23 '12 at 7:41