🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: CFG and PDA: all 10 questions

Quiz: CFG and PDA · Question 7 of 10

A grammar is ambiguous when:

A grammar is ambiguous when:

  1. A.It has more than one variable
  2. B.It generates an infinite language
  3. C.Some string has two different parse trees
  4. D.It uses ε-rules
Answer & explanation

Correct answer: Some string has two different parse trees

Two parse trees mean two ways of grouping, like 2 + 3 * 4 giving 14 or 20.

Can you get the rest right without peeking?

Take the timed Quiz: CFG and PDA quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →