Construct a transition system which can accept strings over the alphabet a,b,……,z containing either cat or rat.
SOLUTION:
∑={a,b}
L =
{cat, rat, acat, bcat, arat, brat,……….. }
Ø So DFA can be Q={ q0 , q1 , q2 ,
q3},∑={a,b,……,z}, q0={ q0},F={q3} and δ is given by the table
1)Transition
diagram:
2)Transition Table:
Present State
|
Next State
|
||||
c
|
a
|
t
|
r
|
b, d,…,q,s,u,..,z
|
|
à q0
|
q1
|
q0
|
q0
|
q1
|
q0
|
q1
|
q2
|
q2
|
q0
|
q1
|
q0
|
q2
|
q0
|
q0
|
q3
|
q0
|
q0
|
* q3
|
q3
|
q3
|
q3
|
q3
|
q3
|
3)Transition function:
δ( q0, c)= q1 ,δ (q0,a)=
q0 ,δ( q0, t)= q0 ,δ (q0,r)=
q1
δ( q1, c)= q2 ,δ (q1,a)= q2 ,δ( q1,
t)= q0 ,δ (q1,r)= q1
δ( q2, c)= q0 ,δ (q2,a)=
q0 ,δ( q2, t)= q3 ,δ (q2,r)=
q0
δ( q3, c)= q3 ,δ (q2,a)=
q3 ,δ( q3, t)= q3 ,δ (q2,r)=
q3
δ{ q0,(b,d,…,q,s,u,…,z)}= q0
δ{ q1,(b,d,…,q,s,u,…,z)}= q0
δ{ q2,(b,d,…,q,s,u,…,z)}= q0
δ{ q3,(b,d,…,q,s,u,…,z)}= q3
This comment has been removed by the author.
ReplyDeleteia this a complete solution?
ReplyDelete