in Theory of Computation edited by
569 views
0 votes
0 votes
Find a grammar that generates the language:

L = {$w$$w^R$ : $w$ ∈ {a, b}+}
in Theory of Computation edited by
569 views

2 Answers

2 votes
2 votes
Best answer

L = {wwR : w ∈ {a, b}+}

Its the language representing the even length palindromes .L={aa,bb,abba.....}

Following is the gammer which generates this:-

S -> a S a | b S b | aa | bb

selected by

1 comment

Could you explain a little bit about wwR? That's a string and its reverse, right? That's where aa and bb come from, because if you have aa, you also have to have bb?

0
0
0 votes
0 votes
S->aSa

     /bSb

    /aa

   /bb

    /E

Related questions