title: Describe the language generated by this context-free grammar
body: <p>I have the following grammar, <br /></p>
  
  <ol>
  <li><em><code>S -&gt; Sb</code></em></li>
  <li><em><code>S -&gt; aaSb</code></em></li>
  <li><em><code>S -&gt; b</code></em></li>
  </ol>
  
  <p>The typical derivations in this grammar are <br />
  <em><code>S =&gt; Sb =&gt; [aaSb]b =&gt; [aa[b]b]b =&gt; aabbb</code></em> for <code>n = 1</code> <br />
  <em><code>S =&gt; Sb =&gt; [aaSb]b =&gt; [aa[aaSb]b]b =&gt; [aa[aabb]b]b =&gt; aaaabbbb</code></em> for <code>n = 2</code></p>
  
  <p>Edit:
  So I claimed that this grammar generates the language <br />
  <em><code>L = {a^(2n)b^(n+2) : n &gt;= 1}</code></em></p>
  
  <p>I am pretty sure that my <em><code>a</code></em> goes <em><code>a^(2n)</code></em> since there's two <em><code>a</code></em> before <em><code>S</code></em>, but what about <em><code>b</code></em>. There is no lambda here so my <em><code>n</code></em> goes from <em><code>n &gt;= 1</code></em>?.</p>
  
  <p>Edit: <br />
  <em><code>b^(n+1)</code></em> and <em><code>b^(2n+1)</code></em> are both wrong assumptions because the grammar can derive a string <code>aaaaaabbbbb</code> if <code>n = 3</code>. <br />
  I modified my <em><code>b</code></em> to be <em><code>b^(n+2)</code></em>.
  so that <em><code>L</code></em> becomes <em><code>L = {a^(2n)b^(n+2) : n &gt;= 1}</code></em></p>