For starters this is a homework question. I have an idea but I am still not able to get the correct answer. I'm not asking for the answer I am just asking for help to answer the question.
I am currently trying to write a context free grammar for the language
a(iterated i times)db(iterated j times), for i and j>=0, and j = 2 * i.
So basically there are twice as many a's as b's and a d in between the 2. For example:
d, adbb, aadbbbb, ……
Here is about what I have, I don't have much... I understand the concept of these CFG's I am just not sure about the logic for this question. I am not sure If i am even going the right direction...
S -> AdB
A -> EMPTY
A -> aAB
B -> DD
Thanks.
i and j >= 0
right? It'd be weird for them to be negative. – Pointy