Consider the following grammar.
S -> (no tokens)
| a S b S
| b S a S
Give a derivation for
the sentence b a a b.
The tree at right is to prove to you that it is possible.
S -> b S a S -> b a S -> b a a S b S -> b a a b S -> b a a b
S -> a S b S -> a S b a S b S -> a S b a S b -> a S b a a S b S b -> a S b a a S b b -> a S b a a b b -> a b a a b b