in Theory of Computation edited by
507 views
3 votes
3 votes

Consider the following CFG :
$S \rightarrow AB$
$A \rightarrow BC \mid a$
$B \rightarrow CC \mid b$
$C \rightarrow a \mid AB$


The Rank of Variable $A$ is:

  1. $2$
  2. $3$
  3. $4$
  4. not possible to define
in Theory of Computation edited by
by
507 views

4 Comments

Thanks...it is clear to me now!!
1
1
@vijaycs here we are getting end of tree

in some transition....so that height we will not consider?
0
0

Cycle present

0
0

1 Answer

2 votes
2 votes
Best answer
if we make a precedence graph for this grammar, there is a loop between A and C, hence we can't conclude the rank of A.
Hence (D) is correct answer!
selected by

4 Comments

what exactly rank of a non terminal is??
0
0
does rank of a non teminal  mean length of longest terminal string generated by it?
0
0

if option have infinity also

then ans will be infinity??

0
0
YES ,I  THINK SO!!
0
0
Answer:

Related questions