-4
$\begingroup$

Can you verify this like please bro please tell me the answer to my question enter image description here

$\endgroup$
1
  • $\begingroup$ No. Your machine accepts ababab. Well, actually it works if the aabb don't have to be together. But usually this question means they have to be all together in a row, so ababab doesn't count. $\endgroup$ Commented Feb 1, 2023 at 20:20

2 Answers 2

1
$\begingroup$

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->Sa.
Saa:   a->Saa,   b->Saab.
Saab:  a->Saab,  b->Saabb.
Saabb: a->Saabb, b->Saabb.
$\endgroup$
-2
$\begingroup$

This automaton only accepts strings that START with aabb. You also need to accept strings such as baabb, bababaabbabab, aabaabb, etc.

$\endgroup$
1
  • 1
    $\begingroup$ It accepts also $baabb$, $bbaabb$ etc. The actual problem is it accepts non-consecutive $aabb$ $\endgroup$
    – kviiri
    Commented Feb 1, 2023 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.