# context free – Does this grammar accept this words?

It looks the grammar indeed accepts all words of the form $$(b+a)^nca^n$$ (which means, all words that start with any sequence of $$n$$ $$b$$‘s and $$a$$‘s, and then a single $$c$$ and afterwards exactly $$n$$ times the letter $$a$$).

To show why, try to show the two following things:

1. every word accepted by the grammar must be with such form

2. every word with such form has a derivation sequence in the grammar.

The first statement can be easily proved by induction (over sequence derivation length), if you notice that each derivation of $$S$$ adds only one element to both sides.

The second statement can be much more easily proved, try to think of what derications are necessary to create such words.