Let G be the CFG: S → aS | Sb | a | b. Show that no string in L(G) contains ba as substring.
First of all, we can't minimize the given grammar further.
Productions generating terminals are S->a and S->b. Both the productions are not generating 'ba'.
Now, lets assume that no string of length at most k has susbstring 'ba'
Now lets look at the string generated with length k+1.
Step 1 in the derivation must be S->aS or S->Sb.
If the derviation is S->aS then we will be able to generate the strings of kind a*S untill we stop reducing S with the production S->aS. Next if you take S->b or S->a or S->Sb, either of them produces a string containing ba.
If the derviation is S->Sb then we will be able to generate the strings of kind Sb* untill we stop reducing S with the production S->Sb. Next if you take S->b or S->a or S->Sb, either of them produces a string containing ba.
Hence the given CFG wont generate the strings containing 'ba'
Let S = {0,1}. Show that the problem of determining whether a CFG generates some string in 1* is decidable. In other words, show that { <G>G is a CFG over {0,1} and 1* n L(G) != 0 }
A CFG G, is specified by its productions below. Convert G to Chomsky Normal Form. S ® aSb | bSa | SS | lambda b) Use the CYK algorithm to determine whether or not the string abba is in L(G).
1. Consider the following grammar A - aB B-Sb (a) Show a derivation tree for the string aabbbb using the grammar. (b) Give an English description of the language generated by the grammar 2. Let G be the grammar below: S-ASB ab | SS (a) Show that G is ambiguous. (b) Construct an unambiguous grammar equivalent to G. 3. Find a context free grammar for the language L3- fa"b"c+m :n,m21) 4. Find a context free grammar for the language L4...
Construct CFG (b) (3 points) CFG: L2 = {wwR | w is a binary string and contains exactly one 1 }, WR is the reverse of w.
Classify the language { (G) | G is a CFG, L(G) contains a palindrome}\ as (a) decidable (b) Turing-recognizable but not co-Turing recognizable (c) co-Turing recognizable but not Turing-recognizable (d) neither Turing nor co-Turing recognizable Justify your answer
Consider the following CFG S ? aB S ? bA B ? b A ? a B ? bS A ? aS B ? aBB A ? bAA Consider the following derivation S ? aB ? aaBB ? aaBb ? aabSb ? aabbAb ? aabbab This derivation is a. a leftmost derivation b. a rightmost derivation c. both leftmost and rightmost derivation d. neither leftmost nor rightmost derivation
CFG questions 1. True or false? Given G: S → aSbSÍ bSaS | λ, L(G) = EQUAL. 2. Provide a grammar for all words that are not palindromes. 3. Provide a grammar for L = { a,b' : is js 2 4. Provide a grammar for L = { aibak: i + j = k }. 5. Provide a grammar for L = { aba: i + k = j).
Let a and b be elements of a group G such that b has order 2 and ab=ba^-1 12. Let a and b be elements of a group G such that b has order 2 and ab = ba-1. (a) Show that a” b = ba-n for all integers n. Hint: Evaluate the product (bab)(bab) in two different ways to show that ba+b = a-2, and then extend this method. (b) Show that the set S = {a”, ba" |...
Must show steps to earn credit. Calculate ΔH° for this process: Sb(s) + 5/2 Cl2(g) ⟶ SbCl5(g) = ΔH° = __??____ kJ Sb(s) + 3/2 Cl2(g)⟶SbCl3(g) ΔH° = −314 kJ SbCl5(g) ⟶ SbCl3(s) + Cl2(g) ΔH° = 80 kJ
i designed cfg form describe L. S -> aaSb | aaaSb | abb can you convert to cfg to pda and draw automata :) Let L = {a0<j<i< 3;}.