Im having trouble doing the following context free grammer questions, the book im using doesnt cover this in the same way so im having trouble just understanding the questions, let alone doing them.
Can anyone clarify the meanings and maybe hint to the working out also. I have attempted the first two but wasnt even really able to attempt the others.
any help would be much appreciated.


1) $S \rightarrow aSb \rightarrow a^4b^2 $ where we apply the first production rule one time and conclude with the second one (with $w = a^2$)
2)I can't understand your solution. We are asked to find all the words of the language. So, again, starting with $S$ we can apply the first production rule any numer $n$ of times but we are always left with a non-terminal symbol, so the second rule must be applied one time (and only one!) to get a correct word. So the language generated is $a^{n+2}b^n$
3)Here I could be wrong, but it seems that you cannot have the given language for any terminal symbol $w$. If you take $w$ as a non-terminal and take as new production rule $ w \rightarrow Sb \vert \epsilon$ (where $\epsilon$ is the null-word), then it should work.
4) The only ways for $a^3b^3 \in L(G(w))$ are $w= \epsilon, ab,a^2b^2$