Example 2: Show that the grammar S ® S | S, S ® a is ambiguous.
Solution: In order to show that G is ambiguous, we need to find a wÎL(G), which isambiguous.
Assume w = abababa.
The two derivation trees for w = abababa is shown below in Fig. (a) and (b).