Construct a DFA, that accepts set of all strings over ∑={a,b} of length at least 2 i.e. |w|>=2


SOLUTION:

∑={a,b}

L = {All the strings of length at least 2 }

L = {aa, ab,ba,bb,aaa,…….,bbb,……….}

Ø  So DFA can be Q={ q0 , q1 , q2},∑={a,b}, q0={ q0},F={ q2} and δ is given by the table

1)Transition diagram:

   2)Transition Table:

Present State
Next State
Input a
Input b
à q0
q1
q1
   q1
q2
q2
* q2
q2
q2

  3)Transition function:
δ( q0, a)= q1     ,δ (q0,b)= q1    
            δ( q1, a)= q2     ,δ (q1,b)= q2   
δ( q2, a)= q2     ,δ (q2,b)= q2

Comments

Search related post on google