Question














4) (9 pts) Give regular expressions for the following languages on (la, b) a) L1 = { w : na(w) mod 3 = 1). b) L2w w ends in aa) c) L3 = all strings containing no more than three as.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) The regular expression for L1 = {w : na(w} mod 3 = 1}

na(w} mod 3 = 1 means that the number of a's can be 1, 4, 7, .... (3*n+1). Regular expression for this is a(aaa)*.

Hence, the overall regular expression is: (b*ab*(aaa)*b*)* (ans).

b) The regular expression for L2 = {w : w ends in aa} is given as:

(a*b*)*aa (ans)

c) The regular expression for L3 = all strings contaning no more than three a's:

b*(a + λ)b*(a + λ)b*(a + λ)b* (ans)

Add a comment
Know the answer?
Add Answer to:
4) (9 pts) Give regular expressions for the following languages on (la, b) a) L1 =...
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