adplus-dvertising
frame-decoration

Question

Consider the following two Grammars:

G1 : S → SbS | a
G2 : S → aB | ab, A→GAB | a, B→ABb | b

Which of the following option is correct?

a.

Only G1 is ambiguous

b.

Only G2 is ambiguous

c.

Both G1 and G2 are ambiguous

d.

Both G1 and G2 are not ambiguous

Answer: (c).Both G1 and G2 are ambiguous

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Consider the following two Grammars: G1 : S → SbS | a G2 : S → aB | ab, A→GAB | a, B→ABb | b Which of the following option is correct?

Similar Questions

Discover Related MCQs

Q. Context sensitive language can be recognized by a:

Q. The set A={ 0^n 1^n 2^n | n=1, 2, 3, ......... } is an example of a grammar that is:

Q. A bottom-up parser generates:

Q. Consider the following statements:

S1 : There exists no algorithm for deciding if any two Turing machines M1 and M2 accept the same language.
S2 : The problem of determining whether a Turing machine halts on any input is undecidable.

Which of the following options is correct?

Q. Which of the following regular expressions, each describing a language of binary numbers (MSB to LSB) that represents non-negative decimal values, does not include even values? (Where {+, *} are quantification characters.)

Q. Which of the following statements is/ are TRUE?

(a) The grammar S → SS a is ambiguous. (Where S is the start symbol)
(b) The grammar S → 0S1 | 01S | ϵ is ambiguous. (The special symbol ϵ represents the empty string) (Where S is the start symbol)
(c) The grammar (Where S is the start symbol)
S → T/U
T → x S y | xy | ϵ
U → yT
generates a language consisting of the string yxxyy.

Q. Pumping lemma for regular language is generally used for proving:

Q. Which of the following problems is undecidable?

Q. Finite state machine can recognize language generated by ....................

Q. The language L = {a^i b c^i | i ≥ 0} over the alphabet {a, b, c} is:

Q. Which of the following statements is not correct?

Q. Context free grammar is not closed under :

Q. Consider the following languages :

L1 = {a^m b^n | m ≠ n}
L2 = {a^m b^n | m = 2n+1}
L3 = {a^m b^n | m ≠ 2n}

Which one of the following statement is correct?