Question

Show the following Grammar is Ambiguios : S -> TU | SbS | SS T ->...

Show the following Grammar is Ambiguios :

S -> TU | SbS | SS

T -> Tb | aT | ^

U -> aU | ^

0 0
Add a comment Improve this question Transcribed image text
Answer #1

S -> TU | SbS | SS

T -> Tb | aT | ^

U -> aU | ^

Given grammar is CFG. For CFG, ambiguity is undecidable problem.

So need to take various input strings and test.

Let’s go here

String: a^b^

Derivation:

S->TU

->TbU

->aTbU

->a^bU

->a^b^

S->TU

->aTU

->aTbU

->a^bU

->a^b^

Two different parse trees are generated for the one string. So given grammar is Ambiguous grammar.

comment below if you have any doubt

Add a comment
Know the answer?
Add Answer to:
Show the following Grammar is Ambiguios : S -> TU | SbS | SS T ->...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT