# Strings which are not in a language generated by a Grammar

I have the following question and its solution

Here T -> XTX since T -> X and X->b S ->XbX since X->a S->aba

So,why is option 3 not accepted ?

• Take a look at the CYK-Algorithm , it is a very mechanical algorithm for checking if a word belongs to a CFG. Perfectly used when you get stuck in interpeting a CFG. – JohEker Nov 13 '18 at 12:29
• @JohEker will take a look at that.Thanks – techno Nov 13 '18 at 14:31

• On what basis do you say that S is the start symbol? If R is not the start symbol, it's useless, although useless non-terminals are completely legit. But the definition of G should be explicit IMHO. Also, what's wrong wirh answering (d)? Those sentences cannot be generated by R or S either. It seems to me that it's really not a very good test question. – rici Nov 14 '18 at 3:25