Design an automaton that accept the the set of strings $a$'s and $b$'s of length at least $2$

154 Views Asked by At

Design an automaton that accept the the set of strings of $a$'s and $b$'s of length at least $2$, for which the final two symbols are different.

DFA

1

There are 1 best solutions below

0
On

Here is a hint:

Designing the DFA is a creative process, you need to experiment and verify.

The DFA has to accept strings of the form $(a|b)^* (ab|ba)$.

First try to design a DFA to accept $(ab|ba)$. This should give something like (excuse crude diagram):

enter image description here

Now try to fill in the other links in the graph (that is, in any of the states, draw an arrow for the unrepresented input), and check that the resulting DFA is correct.