Question

Construct a regular expression that defines the language L (say) containing all the words with either exactly one aba-substri

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

Group 1

Types of words that should be generated:

  • aa…ba defined by the regular expression: aa*ba.
  • abaaaa… defined by the regular expression: abaa*.
  • a(bb)b…(aa)ba - note that the aa -substring and the bb -substring prevent words not belonging to the language to be generated. These words can be generated by the regular expression: abbb*aa
  • If all of these types of words are combined then we have:

a(a* + bb b* aa )*baa*

Group 2

Types of words that should be generated:

bb…ab defined by the regular expression: bb*ab.

babbbb… defined by the regular expression: babb*.

a(aa)a…(bb)ab - note that the aa-substring and the bb-substring prevent words not belonging to the language from being generated. These words can be generated by the regular expression: a(aa)a*(bb)ab.

If all of these types of words are combined then we have:

b(b* + aa a* bb )*abb*

Thus a regular expression that generates all the words in the required language is:

a(a* + bbb*aa)*baa* + b(b* + aaa*bb)*abb*

Add a comment
Know the answer?
Add Answer to:
Construct a regular expression that defines the language L (say) containing all the words with either...
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