Question

2. Give a CFG for each of the following languages where m, n, k, l ≥...

2. Give a CFG for each of the following languages where m, n, k, l ≥ 0.

(a) L = {am bn ck dl  | m = n + k + l}.

(b) L = {am bn ck dl | k = m + n + l}.

(c) L = {am bn ck dl | m + 2l = n + k}.

(d) L = {am bn ck dl | m + k = 2n + l}.

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

a)

Grammar
S -> aSd | A
A -> aAc | C
C -> aCb | epsilon

Explanation
S is to have l number of a's and d's
A is to have l number of a's and c's
C is to have l number of a's and b's

-------- Multiple questions are posted. Answered first one. Please post one at a time. Policy of Chegg.

Add a comment
Know the answer?
Add Answer to:
2. Give a CFG for each of the following languages where m, n, k, l ≥...
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