= Solution
The <word> $abb$ has these two <leftmost derivations>:
$$
\begin{aligned}
S&\Rightarrow UST\Rightarrow aTST\Rightarrow abST
\Rightarrow abT\Rightarrow abb,\\
S&\Rightarrow UST\Rightarrow aST\Rightarrow aSTT
\Rightarrow aTT\Rightarrow abT\Rightarrow abb.
\end{aligned}
$$
In the first <grammar derivation>, $U\to aT$ supplies an extra $b$; the remaining $S$ goes directly to the <empty word>. In the second <grammar derivation>, $U\to a$ is used, and the remaining $S$ uses $S\to ST$ before disappearing. Every step expands the leftmost <nonterminal symbol>, so these are genuinely different <leftmost derivations>, with different <parse trees> already distinguished by the <production rule> at the $U$ node.
\b[Therefore $G$ is an <ambiguous grammar>, witnessed by $abb$.]
$$
\boxed{abb\text{ has two distinct leftmost derivations in }G.}
$$
Back to article page