in Theory of Computation edited by
2,040 views
1 vote
1 vote

Consider Grammar G with the following characteristic-

$A → ax$, where $A ∈ V$$a ∈ T$, $x ∈ V^*$, and any pair $( A, a )$ occurs at most once in $P$. For example, $S → aA \mid aB...,$ is not a grammar of type $G$ because the pair $(S,a)$ occur in two productions. Which of the following is proportional to the effort required to parse a string w belonging to $L(G)$ ?

  1. $\mid w \mid^3$
  2. $\mid w \mid$
  3. $2^{\mid w \mid}$
  4. Not a function of $\mid w \mid$ alone.
in Theory of Computation edited by
2.0k views

2 Answers

1 vote
1 vote
Best answer

Ans-B

As any (A,a) pair occurs only once... we can reduce any variable to terminal at each step. So parsing this type of grammar will require effort equal to length of string.

edited by
0 votes
0 votes

Hope this helps. 

by

Related questions