문제

Language: {a^m b^n : m ≤ 2n}

If someone could give advice on how to approach this to construct the grammar as well as a solution that would be great and much appreciated!

도움이 되었습니까?

해결책

Some hints:

  1. Start with a grammar for { anbn | n in N }.

  2. The grammar you built in part (1) probably worked by laying down a's on one side of the string and b's on the other. That way, there end up being the same number of a's and b's. Try modifying the grammar so that you put down either one a or two a's each step.

Hope this helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top