retagged by
358 views
0 votes
0 votes
Are these two grammars equal?

1->-------------------

S->X|epsilon

X->BBX|epsilon

B->a|b

2->------------

S->AAS|epsilon

A->a|b
retagged by

1 Answer

1 votes
1 votes
They are equivalent , both generating the same language.

Not sure about equal because

$2$) has right recursion on starting state S

but in

$1$) no recursion on initial state  (Assuming S as initial state in both the grammars)

Related questions

750
views
2 answers
5 votes
GO Classes asked Jan 13
750 views
Which one of the following context-free grammars is unambiguous? (Note that $a, b, c,(,),+$ are terminals, $S, X, Y$ are nonterminals, and the start symbol in each case ... $S \rightarrow \epsilon|(S)| S$
428
views
2 answers
3 votes
Jiten008 asked Oct 24, 2023
428 views
Can anyone explain $\overline{ww}$ is $CFL$ or $CSL$ And if $CFL$ can you write the equivalent $CFG$ for this ?