Question

(1) Write a regular expression for the language. (2) Define a finite state machine (FSM) that...

(1)

Write a regular expression for the language.

(2)

Define a finite state machine (FSM) that recognizes words in the language (input alphabet, states, start state, state transition table, and accept states). Include a state digraph for the FSM.

A: For alphabet {p,q,r}, all strings that contain the substring rqr or end with pp.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

given alphabet{p,q,r}

a regular expression for DFA

\large qs=\xi +q3q+q1q

\large q1=qsp +q2p+q3p

\large q2=qsr+q1r+q2r

\large q3=q2q

\large q4=q3r

\large qf=q1p+q4p+q4r+q4q

now taking qf

\large qf=q1p+q4p+q4r+q4q

putting the value of q4

qf=q1p+q3rp+q3rq+q4rr

now putting the value of q1

qf=qsp+q2p+q3p+q3rp+q3rq+q4rr

now putting the value of q3

qf= q2p+q2qp+q2qrp+q2qrq+q4qrr

qf= q2(p+qp+qrp+qrq+qrr)

regular expression for rqr will become

{pqr{r+q+r)*pqr}{(p+p)*}

transition table:

1 E qs P q1 91 qs 92 92 qf r 92 q3 q3 q1 rq q2 q4 91 9939 qs rqr q4 91 qf

state diagraph of the dfa:92 q3 91 94 qs P.ur qf

Add a comment
Know the answer?
Add Answer to:
(1) Write a regular expression for the language. (2) Define a finite state machine (FSM) that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT