wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A context-free grammar is ambiguous if

A
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
it produces more than one parse tree for some sentence
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
some production has two non-terminals side by side on the right-hand side
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
the grammar contains useless non-terminals
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B it produces more than one parse tree for some sentence
A context-free grammar is ambiguous if
1. It produces more than one parse tree for some sentence
or
2.It produces more that one leftmost derivation for some sentence
or
3. It produces more than one rightmost derivation for some sentence.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Context-Free Grammars
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon