retagged by
1,756 views
1 votes
1 votes
Let $G=(V, \Sigma, S, P)$ be a context-free grammar in Chomsky Normal Form with $\Sigma=\{a, b, c\}$ and $V$ containing $10$ variable symbols including the start symbol $S$. The string $w=a^{30} b^{30} c^{30}$ is derivable from $S$. The number of steps (application of rules) in the derivation $S \rightarrow^* w$ is __________.
retagged by

1 Answer

0 votes
0 votes

For CNF, number of steps required is 2|w| - 1

Example: if
S -> AA
A -> a
for string 'aa' we will need 
S -> AA -> Aa -> aa         (Thus number of steps to derive string is 3)

Here the |w| = 90
Thus the number of derivations will be 2*90 - 1 = 179

Answer: 179

Answer:

Related questions

3.5k
views
1 answers
4 votes
Arjun asked Feb 16
3,530 views
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.Operator PrecedenceAssociativity+Highest Left-HighRight*MediumRight/ ... as per the above rules is ________. 
2.6k
views
1 answers
2 votes
Arjun asked Feb 16
2,615 views
Which of the following is/are Bottom-Up Parser(s)?Shift-reduce ParserPredictive ParserLL$(1)$ Parser LR Parser
2.4k
views
2 answers
0 votes
Arjun asked Feb 16
2,409 views
Consider the following syntax-directed definition $\text{(SDD)}$.$S \rightarrow D H T U$ ... $ value computed by the $\text{SDD}$ (in the attribute $S.val$)?$45$50$55$65$
2.2k
views
1 answers
1 votes
Arjun asked Feb 16
2,159 views
Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by $(1), (2)$, and $(3)$ ... $T \rightarrow c T$ (3) $R \rightarrow c R$