COMPUTER SCIENCE AND ENGINEERING
THEORY OF COMPUTATION
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
equal number of a’s and b’s
|
|
odd number of a’s and odd number b’s
|
|
even number of a’s and even number of b’s
|
|
odd number of a’s and even number of a’s
|
Detailed explanation-1: -A language generated by a CFG is a context-free language (CFL).
Detailed explanation-2: -Context free grammar is a formal grammar which is used to generate all possible strings in a given formal language. Context free grammar G can be defined by four tuples as: G= (V, T, P, S)
Detailed explanation-3: -Definition (Context-Free Grammar) : A 4-tuple G = < V, , S, P > is a context-free grammar (CFG) if V and are finite sets sharing no elements between them, S V is the start symbol, and P is a finite set of productions of the form X->, where X V, and ( V )* .
Detailed explanation-4: -We derive strings in the language of a CFG by starting with the start symbol, and repeatedly replacing some variable A by the right side of one of its productions. That is, the “productions for A” are those that have A on the left side of the->. We say A => if A-> is a production. Example: S-> 01; S-> 0S1.