MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

THEORY OF COMPUTATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Regular grammar is
A
context free grammar
B
non context free grammar
C
english grammar
D
none of the mentioned
Explanation: 

Detailed explanation-1: -Every regular grammar is context-free, but not all context-free grammars are regular. The following context-free grammar, for example, is also regular. This grammar is regular: no rule has more than one nonterminal in its right-hand side, and each of these nonterminals is at the same end of the right-hand side.

Detailed explanation-2: -A grammar is regular if and only if is a single nonterminal and is a single terminal or a single terminal followed by a single nonterminal, that is a production is of the form X-> a or X-> aY, where X and Y are nonterminals and a is a terminal.

Detailed explanation-3: -A regular expression is a concept in formal language theory which is a sequence of characters that define a search pattern. Context Free Grammar is a type of formal grammar in formal language theory, which is a set of production rules that describe all possible strings in a given formal language.

Detailed explanation-4: -A context free grammar (CFG) is a forma grammar which is used to generate all the possible patterns of strings in a given formal language. It is defined as four tuples − G=(V, T, P, S) G is a grammar, which consists of a set of production rules. It is used to generate the strings of a language.

There is 1 question to complete.