Question: CFG/PDA Question - (Context Free Grammar) - I need to create a grammar for the Language L = {a n b n +m c m

CFG/PDA Question - (Context Free Grammar) - I need to create a grammar for the Language L = {anbn +mcm, n CFG/PDA Question - (Context Free Grammar) - I need to create a 0, m grammar for the Language L = {anbn +mcm, n 0, m 1 1 }

I tried something like

S -> aC | bD

C -> aC|bD

D -> bD | cE

E -> cE | c

This works for the correct number of variables i.e. abbbcc, but also works for the incorrect number of variables. i.e. aabbbcc when it should not. How do I design the grammar to only produce the correct strings?

Also, I need to construct a PDA for this same scenario. (we use JFLAP, but any diagram explaining would help me)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!