hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
arrow
arrow
arrow
An ambiguous grammar is one which has: A. More than one derivation B. More than one left most derivations C. More than one right most deri
Question



An ambiguous grammar is one which has:
A. More than one derivation
B. More than one left most derivations
C. More than one right most derivations
D. More than one Parse tree
E. More than one syntax tree
Choose the correct answer from the options given below:

A.

A and D Only

B.

B and C Only

C.

D and E Only

D.

A,B,C,D and E

Correct option is D


An ambiguous grammar is a context-free grammar for which there exists at least one string that can have more than one parse tree (syntax tree). This means that for such a string, there are multiple valid ways to derive it according to the grammar rules, leading to multiple derivations and parse trees.
· More than one derivation: Ambiguity implies that there are multiple ways to derive the same string. This includes multiple leftmost and/or rightmost derivations. This is the true statements.
· More than one leftmost derivation: Ambiguity means that there can be multiple leftmost derivations for the same string. This is the true statements.
· More than one rightmost derivation: This is true. An ambiguous grammar can have multiple rightmost derivations for the same string.
· More than one parse tree: This is  true. A parse tree visually represents the derivation of a string according to the grammar rules. If a string has more than one parse tree, it means the string can be derived in multiple ways, leading to ambiguity.
· More than one syntax tree: This is  true. Syntax trees are essentially another form of parse trees. If there are multiple syntax trees for a single string, it indicates the string can be parsed in multiple ways, showing ambiguity.
An ambiguous grammar is characterized by having multiple derivations, multiple leftmost and rightmost derivations, and multiple parse (or syntax) trees for at least one string in the language. Therefore, all the statements A, B, C, D, and E are true for an ambiguous grammar.

test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
176k+ students have already unlocked exclusive benefits with Test Prime!

Free Tests

Free
Must Attempt

UGC NET Paper-I (21 August 2024 Shift 2)

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper-I (21 August 2024 Shift 2)

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper-I (21 August 2024 Shift 2)

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English