I spent some time looking over the examples in this article on Wikipedia, and I think this works:
S → aSc | A
A → bAcc | ε
Example 7 is pretty similar so it wasn't too hard.
Fun problem!
Hey guys!
I came across the question in my tutorial. Mind you the text book was no help. Any one who could help would be greatly appreciated!!!
Find the context-free grammar for the follwoing language:
L= {a^n b^m c^k : n +2m = k}
with n≥0, m≥0, k≥0
Thanx!!
I spent some time looking over the examples in this article on Wikipedia, and I think this works:
S → aSc | A
A → bAcc | ε
Example 7 is pretty similar so it wasn't too hard.
Fun problem!