Design the grammar for the following: L = (a^n)w(w^r)(b^n) where n>=0 and w={a,b}
Asked
Active
Viewed 105 times
1 Answers
0
The answer goes something like this
S->ε/ aSb
S->A
A->ε/ aAa / bAb
here is a sample string for the above with proof
aabaabbb
S=>aSb
S=>aaSbb
S=>aaAbb
S=>aabAbbb
S=>aabaAabbb
S=>aabaεabbb
S=>aabaabbb
here above symbol ε is epsilon
Vishal Kalwapalli
- 59
- 7