Question

Give a regular expression for each of the following languages. r. { x∈{a, b}* | the...

Give a regular expression for each of the following languages.

r. { x∈{a, b}* | the number of as in x is odd}∪{bn​ ​ | n is odd}∪{(aba)n​ ​}
s. {an​ ​| n is divisible by at least one of the numbers 2, 3, or 5}

q. {x∈{a, b}* | the number of as in x is odd}

u. {xy ∈ {a, b}* | the number of as in x is odd and the number of bs in y is even}
0 0
Add a comment Improve this question Transcribed image text
Answer #1

q:

b*ab*(b*ab*ab*)*

The part in () represent number of even a's. we add one a in front to make it odd.

r:

b*ab*(b*ab*ab*)* + b(bb)* + (aba)*

first part for odd a, second for odd bs and third for aba

s:

(aa)* + (aaa)* + (aaaaa)*

first for 2, second for 3 and third for 5

u:

(b*ab*(b*ab*ab*)*).((a*ba*ba*)*a*)

x = b*ab*(b*ab*ab*)*

y = (a*ba*ba*)*a*

Hope this helps.

Please rate the answer if you like it.

Do leave a comment.Any suggestion/query is much appreciated.

Add a comment
Know the answer?
Add Answer to:
Give a regular expression for each of the following languages. r. { x∈{a, b}* | the...
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