in Theory of Computation
993 views
1 vote
1 vote

Find a context-free grammar for the following language (with n ≥ 0, m ≥ 0):

L = {anwwRbn : w ∈ {a, b} ∗ , n ≥ 1}.

in Theory of Computation
993 views

1 Answer

3 votes
3 votes

L = {anwwRbn : w ∈ {a, b} ∗ , n ≥ 1}.

S -> a S b | W

W -> a W a   |   b W b   |  $\epsilon$

First using S, get equal a and b then terminate it with palidrome which is given by W. 

Related questions