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 | ε
1. show abbabaab ∈ L(G) ------------- L = {wwr : w ∈ {a, b}*}
1. show abbabaab ∈ L(G) ------------- L = {wwr : w ∈ {a, 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?
A long string of mass per unit length of 0.65 g/m is attached at the point...
A long string of mass per unit length of 0.65 g/m is attached at the point x = 0 to another long string of mass per unit length of 0.52 g/m. The strings are stretched out under a constant tension T = 81 N. A wave of amplitude 1.8 cm and wavelength 11 cm is generated in the lighter string. 1 (a) What is the speed of the wave in the lighter string? (b) What are the speed and wavelength...
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 all your steps and draw diagrams where necessary. 1.         A 780-g mass is attached to a...
Show all your steps and draw diagrams where necessary. 1.         A 780-g mass is attached to a vertical spring and lowered slowly until the mass rests at its equilibrium position 30 cm below the original length of the spring. It is then set into simple harmonic motion of amplitude 5 cm.             (a)        What is the frequency and period of the oscillation? (b)       What is the maximum velocity of the oscillating mass? Where does the maximum velocity occur? (c)        What is the maximum acceleration of...
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
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT