Question

Show that if G is a CFG in Chomsky normal form, then for any string w...

Show that if G is a CFG in Chomsky normal form, then for any string w is a member of L(G) of length n >=1, exactly 2n-1 steps are required for any derivation of w.

Homework Answers

Answer #1

To Show that exactly 2n-1 steps will be required we begin with a start variable or the single non-terminal ("S") and form the string w by making substitutions, according to the rules of normal form. Each rule of the form A to BC (A->BC) adds a new non-terminal, and each rule of the form A to a (A->a) converts one non-terminal into a terminal. Since it takes (n-1) steps to grow our string from the original non-terminal to n non-terminals because the first terminal is given hence n-1 steps are required to reach to n non-terminals, and then n steps to convert each of those non-terminals into terminals as in the form of converting non-terminals to terminals whole n steps have to be undertaken, it takes 2n-1 steps to derive a string of length n (n-1+n = 2n-1).

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
Theory of Computation Problem 3: Let G be an arbitrary CFG (Context-free Grammer), and let DG...
Theory of Computation Problem 3: Let G be an arbitrary CFG (Context-free Grammer), and let DG be the string-pushing PDA(pushdown automata) for it. Let w be some string of length n in L(G). Suppose you know that the leftmost derivation of w in G consists of m substitutions. How many transitions would be in the corresponding computation of DG for input string w? Justify your answer carefully! All information is given ----------------------------------------------------------------- Upvote for the right answer!! Thanks
Obtain a grammar in Chomsky Normal Form (CNF) equivalent to the grammar G with productions P...
Obtain a grammar in Chomsky Normal Form (CNF) equivalent to the grammar G with productions P given S ->aAb | B A ->aA | a B-> bB | b
Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form....
Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form. S −→ AaA | AB A −→ BB | bAA | ε B −→ bS | b | ε
Show that if G is a nilpotent group and 1 ≠ N, and N is normal...
Show that if G is a nilpotent group and 1 ≠ N, and N is normal in G, then N ∩ Z(G) ≠ 1.
1) Let G be a group and N be a normal subgroup. Show that if G...
1) Let G be a group and N be a normal subgroup. Show that if G is cyclic, then G/N is cyclic. Is the converse true? 2) What are the zero divisors of Z6?
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as an input. The first task is to compute the frequency of each character appearing in the string. In the output, the characters have to be arranged in the same order as they appear in the input string. Then characters have to be rearranged, such that all the characters having a specific frequency, say xx, come together. Let the frequency of a character, lying in...
Show how you would convert benzaldehyde into each of the following. You may use any other...
Show how you would convert benzaldehyde into each of the following. You may use any other needed reagents, and more than one step may be required. a.) Benzyl Alcohol b.) Benzoic Acid c.) Benzoyl chloride d.) Benzophenone e.) 1-Phenylethanol f.) 3-Methyl-1-phenyl-1-butanol g.) Benzyl bromide h.) Toluene i.) C6H5CH(OCH3)2 j.) C6H5CH18O k.)C6H5CHDOH l.) C6H5CH(OH)CN m.) C6H5CH=NOH n.) C6H5CH=NNHC6H5 o.) C6H5CH=CHCH=CH2
Write a program of wordSearch puzzle that use the following text file as an input. The...
Write a program of wordSearch puzzle that use the following text file as an input. The output should be like this: PIXEL found (left) at (0,9). ( Use JAVA Array ) .Please do not use arrylist and the likes! Hints • The puzzle can be represented as a right-sized two-dimensional array of characters (char). • A String can be converted into a right-sized array of characters via the String method toCharArray. . A word can occur in any of 8...
MATH125: Unit 1 Individual Project Answer Form Mathematical Modeling and Problem Solving ALL questions below regarding...
MATH125: Unit 1 Individual Project Answer Form Mathematical Modeling and Problem Solving ALL questions below regarding SENDING A PACKAGE and PAINTING A BEDROOM must be answered. Show ALL step-by-step calculations, round all of your final answers correctly, and include the units of measurement. Submit this modified Answer Form in the Unit 1 IP Submissions area. All commonly used formulas for geometric objects are really mathematical models of the characteristics of physical objects. For example, a basketball, because it is a...
Report results to 5 significant figures. Show all units of measurement as appropriate. 3. What (a,b)...
Report results to 5 significant figures. Show all units of measurement as appropriate. 3. What (a,b) are the two parameters of any binomial distribution?  Using these parameters, what (c, d) are the expressions used for calculating the mean and standard deviation of a binomial distribution?  In order to be able to approximate a binomial distribution using a Normal distribution, (e, f) what are the two criteria that must be met?  In one of Gregor Mendel’s genetics experiments, he expected 75% of pea plants...