Can you verify this like please bro please tell me the answer to my question
2 Answers
Have 5 states S, Sa, Saa, Saab, Saabb. Move to a state Sxxx after you parsed the first characters xxx of aabb, except you stay in the accepting state Saabb no matter what the input once you reached it.
S: a->Sa, b->S.
Sa: a->Saa, b->S.
Saa: a->Saa, b->Saab.
Saab: a->Sa, b->Saabb.
Saabb: a->Saabb, b->Saabb.
This automaton only accepts strings that START with aabb. You also need to accept strings such as baabb, bababaabbabab, aabaabb, etc.
-
1$\begingroup$ It accepts also $baabb$, $bbaabb$ etc. The actual problem is it accepts non-consecutive $aabb$ $\endgroup$– kviiriFeb 1 at 16:01