1,439 views
0 0 votes

Consider the following two ambigious context free grammars. 


Which of the above ambigious CFG’s has an equivalent unambiguous CFG

  • I only
  • II only
  • Both I and II
  • Neither I nor II

3 Answers

1 1 vote

every DCFL have unambiguous grammar .

both languages are DCFL then it must have an equivalent unambiguous grammar .

0 0 votes
For 1st one we have $S\rightarrow aSb / \epsilon$.

For 2nd one we have $S\rightarrow aaSb/ aab/ aSb/ \epsilon$
Position:
Show:

Related questions

2 2 votes
0 0 answers
408
408 views
GO Classes asked Mar 17
408 views
Consider the following C program:#include <stdio.h void func(int *a, int *b) { int i = (*a) * (*b); int *j = b; for (;;) { if (i 20) ...
0 0 votes
0 0 answers
314
314 views
GO Classes asked Mar 17
314 views
Consider a hash table with $100$ slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first $3$ slots are unfi...
2 2 votes
1 1 answer
368
368 views
GO Classes asked Mar 17
368 views
Size of $\verb|int|$ is $\mathrm{2~B}$ and size of $\verb|float|$ is $\mathrm{4~B}$Consider the following C++ program:#include<iostream using namespace std; int main() { ...
1 1 vote
1 1 answer
284
284 views
GO Classes asked Mar 17
284 views
Consider the following C declarations and their interpretations:$\verb|void * foo(void *)| : \verb|foo|$ is a function that takes an argument of type $\verb|void|$ and re...