Question

Recursively define strings in the following language: A = {0^(n)1^(n+m)0^(m) | n,m >= 0} Then create...

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.

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
L = { am b n | m < n - 2}. (a) Define the context...
L = { am b n | m < n - 2}. (a) Define the context free grammar G that generates the formal language L. (b) Define the deterministic pushdown automaton A that recognize the formal language L. (c) Implement the pushdown automaton A in your favorite programming language.
L = { am b n | m < n - 2}. (a) Define the context...
L = { am b n | m < n - 2}. (a) Define the context free grammar G that generates the formal language L. (b) Define the deterministic pushdown automaton A that recognize the formal language L. (c) Implement the pushdown automaton A in your favorite programming language.
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m...
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m < n-2 isn’t regular. (I'm using the ^ notation but your free to make yours bman instead of (b^m)(a^n) ) Use the pumping lemma for regular languages.
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m...
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m < n-2 isn’t regular. Use the pumping lemma for regular languages.
For the given language descriptions below, write a context-free grammar. Assume that your alphabet is ∑...
For the given language descriptions below, write a context-free grammar. Assume that your alphabet is ∑ = {?, ?, ?}, define a grammar that generates a string cmanbanck, where ‘m’, ‘k’, and ‘n’ represents the amount of a character. Assume that m, k ≥ n and m, k, n ≥ 0.
Define a sequence (xn)n≥1 recursively by x1 = 1 and xn = 1 + 1 /(xn−1)...
Define a sequence (xn)n≥1 recursively by x1 = 1 and xn = 1 + 1 /(xn−1) for n > 0. Prove that limn→∞ xn = x exists and find its value.
prove that the language L = {a^n+1 b^2n(aa)^n b | n > 0} is non-context free....
prove that the language L = {a^n+1 b^2n(aa)^n b | n > 0} is non-context free. Using pumping lemma with length
Define a set M recursively as follows. B. 3 and 7 are in M R. If...
Define a set M recursively as follows. B. 3 and 7 are in M R. If x and y are in M, so is x+y. (it is possible that x = y) Prove for every natural number n greater than or equal to 12, n is an element of M
A fully parenthesized arithmetic expression is defined recursively as: (a) A natural number expressed in decimal...
A fully parenthesized arithmetic expression is defined recursively as: (a) A natural number expressed in decimal notation (e.g., 0, 4, 357, but not 007). (b) (α+β) or (α∗β), whereαandβare fully parenthesized arithmetic expressions. Define a CFG that generates the following language over {0,1,...,9,(,),∗,+,o,d,e,v,n}: L={α odd:αis a fully parenthesized arithmetic expression with an odd value} ∪ {α even:αis a fully parenthesized arithmetic expression with an even value} For example, “75 odd”, “((241∗2) + 40034) even” are strings in the language (ignore...
Consider the language L = { w w : w ∈ { 0 , 1 }...
Consider the language L = { w w : w ∈ { 0 , 1 } ∗ } is not context-free. Note that this is the language of all strings that consist of some combination of 0s and 1s, followed immediately by that same combination of 0s and 1s. For example, 0101, 101101, and 110110 are all in the language because they consist of a string followed by itself. Can you build a PDA to recognize this language? (Hint: you...