0
$\begingroup$

Language: $\{w \mid w \in \{ab\}^*\}$

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ By the way, writing $\{w\mid w\in \{ab\}^*\}$ seems a complicated way to write $\{ab\}^*$. $\endgroup$ Nov 8, 2012 at 2:38

3 Answers 3

3
$\begingroup$

It has problems in both directions: it doesn’t accept the empty word, which is in the language, and it does accept a lot of words, like $aba$ and $abb$, that aren’t in the language. The first problem is easily fixed: just make $q_0$ an acceptor state. The second requires some more significant changes. The $b$-transition from $q_3$ should go to $q_1$, the garbage state, and the $a$-transition should go to a new non-accepting state $q_4$. Can you then fill in what the two transitions from $q_4$ should be?

Alternatively, you could get rid of $q_3$ and have a $b$-transition from $q_2$ to $q_1$, using only three states altogether.

$\endgroup$
1
  • $\begingroup$ I see. ok..working on fixing it now. $\endgroup$
    – zeqof
    Nov 8, 2012 at 7:15
1
$\begingroup$

No it is not correct, your DFA accepts all strings starting with $ab$ and it doesn't accept the empty string.

$\endgroup$
0
$\begingroup$

your DFA will only accept string which starts from ab .so to make it work make every state will be a final state.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .