-1

four options:-

A. 8

B. 9

C. 6

D. None

can somebody please explain the answer diagrammatically..

Community
  • 1
  • 1

2 Answers2

1

The accepted answer is wrong. Consider the following minimal DFA for the language:

q    e    q'
q0   0    q0
q0   1    q1
q0   2    q0
q1   0    q2
q1   1    q3
q1   2    q2
q2   0    q0
q2   1    q1
q2   2    q0
q3   0    q2
q3   1    q3
q3   2    q2

The reason the other answer gets it wrong is because there is no real difference between symbols 0 and 2 in this language. The symbols might as well be "1" and "not 1". When you correctly realize this, the minimal number of states is indeed as the other answer points out: 2^2 = 4 states. Here's a crude diagram if that's more easy to digest.

  /------0,2--------\
 |         /---1--\ |
 v        v        \|
q0 --1-> q1 -0,2-> q2
         |          ^
         1          |
         v          |
         q3---0,2--/
        / ^
        \1/
Patrick87
  • 27,682
  • 3
  • 38
  • 73
0

B.9

Whenever the question says the nth symbol from the right side is fixed and the input language has m symbols the answer for minimal dfa is m^n . So 3^2 = 9