View worked solution
Answer: 179
In a Context-Free Grammar (CFG) in Chomsky Normal Form (CNF), all production rules must be of one of the following forms:
- (where are variables)
- (where is a terminal)
To derive a string of length () from the start symbol :
- We start with variable ().
- Each application of a production of the form increases the number of variables in the sentential form by exactly . To reach a sentential form containing variables, we need exactly steps.
- Each of these variables must then be replaced by a terminal using a production of the form . This requires exactly steps.
Thus, the total number of steps (rule applications) in the derivation of any string of length is:
For the given string , the length of the string is:
Substituting into the formula:
Note: The number of variable symbols (10) is extra information and does not affect the number of derivation steps.
Free practice · Your answers on this page are not saved.
