= Solution
Take the productions
$$
S\to AA,
\qquad A\to a,
$$
and the word $w=aa$. There is only one parse tree: its root uses $S\to AA$ and each child uses $A\to a$. There are nevertheless exactly two derivations,
$$
S\Rightarrow AA\Rightarrow aA\Rightarrow aa
$$
and
$$
S\Rightarrow AA\Rightarrow Aa\Rightarrow aa,
$$
according as the left or right occurrence of $A$ is replaced first. This illustrates that derivations record replacement order while a <context-free grammar> parse tree does not.
Back to article page