0

The problem is designing context-free grammars generating the following languages.

The set of strings over the alphabet Σ = {a, b} with twice as many a’s as b’s. I found a solution but I don't know how to get this.

S → SS | aaSb | bSaa | aSbSa | $\epsilon$

Mark
  • 1
  • 1
  • I just found that this solution is incorret.... S can not produce "bbaaaa". I edited it. – Mark Oct 24 '16 at 03:00
  • 1
    I don't understand the question. Are you asking if there is a formula or algorithm to automatically generate a grammar for a particular language? – tjhighley Oct 24 '16 at 04:13
  • @tjhighley Just design the context free grammar for this problem~ – Mark Oct 24 '16 at 06:03
  • 2
    I don't understand what you're looking for. Could you ask a more precise question? (Actually, could you ask a question at all? There are no literal questions in your post and I can't understand what is the question you're trying to imply.) – David Richerby Oct 24 '16 at 07:55

0 Answers0