I had an exam today, and I think that there was a mistake in the following question:
Let $G$ be the grammar defined by $$G=(\{S,A,B\},\{a,b\},\{S \rightarrow AB, A \rightarrow a, A \rightarrow AS, B \rightarrow bb \},S)$$ and the language $$L=\{a^n b^{2n},n ∈ \mathbb N \}$$ Show that $L(G) = L$.
I think the wrong part is: $A \rightarrow AS$ since we can generate the string $w =AAABBB$ and then since $A \rightarrow AS$, $w$ can be $ASAABBB$, then $ABAABBB$ which is wrong in our case.
Am I right?
Yes, this is correct. The $A \to AS$ is probably a typo for $A\to aS$ (everything works fine if you make this one-letter change).