1.

State true or false:Statement: Every right-linear grammar generates a regular language.(a) Statement: Every right-linear grammar generates a regular language.(b) True(c) FalseThe question was asked during a job interview.Question is from Sentential Forms topic in portion Context Free Grammars and Languages of Automata Theory

Answer»

Correct OPTION is (a) Statement: EVERY right-linear grammar generates a regular language.

For explanation I would SAY: A CFG is said to right linear if each production body has at most one variable, and that variable is at the right END. That is, all productions of a right linear grammar are of the form A->wB or A->w, where A and B are variables while w is some terminal.



Discussion

No Comment Found

Related InterviewSolutions