MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

THEORY OF COMPUTATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If all the production rules have single non-terminal symbol on the left side, the grammar defined is
A
context free grammar
B
context sensitive grammar
C
unrestricted grammar
D
phrase grammar
Explanation: 

Detailed explanation-1: -A right-regular grammar is a context-free grammar in which the right-hand side of every production rule has one of the following forms: the empty string; a string consisting of a single non-terminal symbol; or a string consisting of a single terminal symbol followed by a single non-terminal symbol.

Detailed explanation-2: -Explanation: If all the production rules have single non – terminal symbol on the left side, the grammar defined is context free grammar.

Detailed explanation-3: -Context-free grammars consist of terminals (w1, w2, …, wV), nonterminals (N1, N 2, …, Nn), a start symbol (N1), and rules. Terminal symbols represent context that appear in the strings generated by the grammar. Nonterminal symbols are placeholders for patterns of terminal symbols that can be generated by nonterminals.

Detailed explanation-4: -In which derivation the right-most non-terminal symbol is replaced at each step? Answer: (C) 24.

Detailed explanation-5: -In an unrestricted grammar, a production is of the form, where and are arbitrary strings of terminals and nonterminals, and may not be the empty string. If is the empty string, this is denoted by the symbol, or (rather than leave the right-hand side blank).

There is 1 question to complete.