1
$\begingroup$

I attempted a mock paper for finite automata .so i was asked to create a DFA which accepts a language in which inputs are a,b and number of b's should be divisible by 3.The first image is my answer for which i was not given marks .but when i checked the answer of the paper they gave the second image as the correct answer.Both the DFA give the accept the language(number of b divisible by 3),so can any one tell how the second DFA in the second is better than the first one,or where did i go wrong.

DFA where number of b's divisible by 3

$\endgroup$
  • 2
    $\begingroup$ You have forgotten to label one of the arcs in (b). I assume it is b. $\endgroup$ – Shreesh Apr 26 '16 at 18:13
4
$\begingroup$

First DFA does not accept $\epsilon$ which has 0 number of $b$'s which is divisible by 3 (0 is said to be divisible by 3). So first answer is incorrect, where as second is correct.

$\endgroup$
-1
$\begingroup$

There is no problem with your DFA but the reason why the second image is more appropriate is because the DFA is having less number of states in other words it is an (optimized/minimized) DFA .May be you have not gone through further topics in finite automata like minimization of DFA .After covering that topic even you will end up with DFA which is minimized like the second DFA in the image. Its better if you cover all topics in finite automata before attempting mock tests.

$\endgroup$
  • $\begingroup$ Wrong, first one is incorrect because it accepts a proper subset of language only. It does not accept $\epsilon$. $\endgroup$ – Shreesh Apr 26 '16 at 18:15
  • $\begingroup$ yes sorry shreesh is correct i did not consider the epsilon $\endgroup$ – Vishal Kalwapalli Apr 26 '16 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy