Recursively define strings in the following language:
A = {0^(n)1^(n+m)0^(m) | n,m >= 0}
Then create a context-free grammar to describe the language.
Given Language:
Corresponding Strings table:
Values | Strings |
n=0, m=0 | {} |
n=0, m=0 | {01{ |
n=0, m=0 | {10} |
n=0, m=0 | {0110} |
n=0, m=0 | {001110} |
n=0, m=0 | {011100} |
n=0, m=0 | {00111100} |
Grammer of the strings ->
S -> AB
A -> 0A1 |
B -> 1B0 |
Contet free grammer for A:
here,
V = {S,A,B}
= {0,1}
P = { S -> AB, A -> 0A1 | , B -> 1B0 | }
S = {S}
-------------------------END---------------------
Please give a thumbs up(upvote) if you liked the answer.
Get Answers For Free
Most questions answered within 1 hours.