Question

Use CFG or PDA to prove L= {0a1b0c : b ≠ a + c; a, b,...

Use CFG or PDA to prove L= {0a1b0c : b ≠ a + c; a, b, c ≥ _0} is a context-free language. Please add your explanation, thank you.

If you can use the theorem(union of CFL and regular language = CFL) is also welcomed.

Homework Answers

Answer #1

A language L is context-free if ∃ CFG G : L(G) = L

Give a CFG for L =  {0a1b0c : b ≠ a + c; a, b, c ≥ _0}

L says some of an's ought to be equivalent to some of b's. Their link says the first number of an's ought to be equivalent to the quantity of b's. In this way, we can make a PDA which will initially push for a's, fly for b's. So it very well may be acknowledged by pushdown automata, consequently setting free.

Sol:- Let L is context free. Then, L must satisfy pumping lemma. At first, choose a number n of the pumping lemma. Then, take z as 0n1n2n.

G = (V, Σ, R, S) with set of variables V = {S, X}, where S is the start variable; set of terminals Σ = {a, b, c}; and rules S → aSc | X X → bXc | ε

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
Problem 4. Convert RE to CFG We saw in class how to construct CFGs for U,...
Problem 4. Convert RE to CFG We saw in class how to construct CFGs for U, *, and o operations for existing CFL's. We also saw how to construct CFG's for regular expressions empty-set, e, and c (where c is some member of S). a) Using these constructions, create CFG for the RE R = x ((yx)* U y). This is an algorithm for converting any RE to a CFG with start variable S0. It works as follows: create an...
Are the following languages over {a, b} regular? If they are then prove it. If they...
Are the following languages over {a, b} regular? If they are then prove it. If they are not prove it with the Pumping Lemma {an bm | m != n, n >= 0} {w | w contains the substring ‘aaa’ once and only once } Clear concise details please, if the language is regular, provide a DFA/NFA along with the regular expression. Thank you. Will +1
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.
4. Let a, b, c be integers. (a) Prove if gcd(ab, c) = 1, then gcd(a,...
4. Let a, b, c be integers. (a) Prove if gcd(ab, c) = 1, then gcd(a, c) = 1 and gcd(b, c) = 1. (Hint: use the GCD characterization theorem.) (b) Prove if gcd(a, c) = 1 and gcd(b, c) = 1, then gcd(ab, c) = 1. (Hint: you can use the GCD characterization theorem again but you may need to multiply equations.) (c) You have now proved that “gcd(a, c) = 1 and gcd(b, c) = 1 if and...
(complexity theory): let language C be: C = {<p,n> | p and n are natural numbers...
(complexity theory): let language C be: C = {<p,n> | p and n are natural numbers and there is no prime number in the range [p,p+n]} a)explain if the given explanation is good, or if it is bad, explain why: a professor wanted to prove that language C belongs to class NP like this: "for each word <p,n> that belongs to C, there is a confirmation that proves its belonging to the language: the confirmation is formulated by a non...
1. Prove that an integer a is divisible by 5 if and only if a2 is...
1. Prove that an integer a is divisible by 5 if and only if a2 is divisible by 5. 2. Deduce that 98765432 is not a perfect square. Hint: You can use any theorem/proposition or whatever was proved in class. 3. Prove that for all integers n,a,b and c, if n | (a−b) and n | (b−c) then n | (a−c). 4. Prove that for any two consecutive integers, n and n + 1 we have that gcd(n,n + 1)...
Discrete Math In this assignment, A, B and C represent sets, g is a function from...
Discrete Math In this assignment, A, B and C represent sets, g is a function from A to B, and f is a function from B to C, and h stands for f composed with g, which goes from A to C. a). Prove that if the first stage of this pipeline, g, fails to be 1-1, then the entire pipeline, h can also not be 1-1. You can prove this directly or contrapositively. b). Prove that if the second...
Use the combinations formula to prove that in general C(n, r) = C(n, n - r)....
Use the combinations formula to prove that in general C(n, r) = C(n, n - r). Use the permutations formula to evaluate for any whole number n, P(n, 0). Explain the meaning of your result. Use the combinations formula and the definition of 0! to evaluate, for any whole number n, C(n, 0). Explain the meaning of your result. Suppose you have 35 songs for a playlist consisting of only 5 songs. How many different playlists can you have?
Use the bond energies provided to estimate deltaH rxn for the reaction below. 2 Br2(l) +...
Use the bond energies provided to estimate deltaH rxn for the reaction below. 2 Br2(l) + C2H2(g) ---> C2H2Br4(l) DeltaHrxn = ? Bond Bond Energy (kJ/mol) Bonds Broken Bonds Formed Br-Br 193       C:::C 837 C-C 347 C-Br 276 C-H 414 I did not know how to work this problem out on our midterm and since our final is cumulative I need to understand this. Can you please give me a step by step procedure how to work this...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT