Question

Question 3. Write down a regular expression that denotes the following language. L = {a^m b^n...

Question 3. Write down a regular expression that denotes the following language.

L = {a^m b^n : m + n is even}

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

Solution:

The above problem gives rise to two possible cases.

m+n must be even. To achieve this, we must see that both m and n must be even or both must be odd. Only then m+n can be even.

The two cases are as follows:

n is even and m is even:

The regular expression for this is as follows.

(aa)*(bb)*

m is odd and n is odd:

a(aa)*b(bb)*

Combining the above two cases, the regular expression is as follows.

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

Add a comment
Know the answer?
Add Answer to:
Question 3. Write down a regular expression that denotes the following language. L = {a^m b^n...
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