507 views

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

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

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

Cycle present

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.

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

if option have infinity also

then ans will be infinity??

YES ,I  THINK SO!!

1
577 views