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.
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.
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...
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
In Python language: Create a function that takes as input two numbers, m and n, m<n,...
In Python language: Create a function that takes as input two numbers, m and n, m<n, and returns an m×n list-of-list-of-numbers. Each element of the outer list will be a list of consecutive integers, beginning with 1 and ending with n−1. If you're feeling bold, try to use list comprehension.
Design a DFA accepting the language of all strings over Σ = {0, 1} with the...
Design a DFA accepting the language of all strings over Σ = {0, 1} with the property that the number of 0s and the number of 1s in a string are both odd.
Define a sequence (xn)n≥1 recursively by x1 = 1, x2 = 2, and xn = ((xn−1)+(xn−2))/...
Define a sequence (xn)n≥1 recursively by x1 = 1, x2 = 2, and xn = ((xn−1)+(xn−2))/ 2 for n > 2. Prove that limn→∞ xn = x exists and find its value.
Suppose T(n) is defined recursively as: T(0) = 1 T(n) = 3T(n-3) + O(n) True or...
Suppose T(n) is defined recursively as: T(0) = 1 T(n) = 3T(n-3) + O(n) True or false: T(n) ∈ O(2n)
Consider the language defined by L = {aibmcn | i > 0, n > m >...
Consider the language defined by L = {aibmcn | i > 0, n > m > 0 } Is L regular or not? Prove it
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT