in Theory of Computation edited by
749 views
1 vote
1 vote

Which of the following is false for derivation tree of CFG-  $G (V, T, P, S)$ ?

  1. The root is labeled $S$.
  2. Every leaf has a label from $V ⋃ T ⋃ \{ λ \}$.
  3. A vertex with a child labeled $λ$ can only have it as the rightmost child.
  1. $\text{1 & 3}$
  2. $\text{1 & 2}$
  3. $\text{2 & 3}$
  4. $\text{Only 2}$
in Theory of Computation edited by
749 views

2 Comments

Where is the CFG ... .to me it seems this is half question...
0
0
Cfg can be any cfg.
0
0

1 Answer

0 votes
0 votes

Ans--C        ....    considering derivation tree for string in Language.

1) starting symbol will be root True.

2)Leaf node will contain symbol from {T} U {epsilon}, so False

3) epsilon can be anywhere, so False.

4 Comments

edited by
The leaf whose value is epsilon cannot have other siblings. Your answer is right but the third argument is wrong.
0
0
$S->Sa|\lambda\implies S\rightarrow Sa\rightarrow\lambda a\rightarrow a$[Here $\lambda$ is to the left]

$S->aS|\lambda\implies S\rightarrow aS\rightarrow a \lambda \rightarrow a$[Here $\lambda$ is to the right]

Both are valid CFGs.
1
1
Please check the derivation trees of the examples you have cited here.
0
0
@tarun_svbk I understood your point in the previous comment and I agree but the statement given is if a vertex has a child labelled $\lambda$, then it has to be on the right which is wrong by virtue of the counter examples I gave above but what you were saying is not what the statement says, the statement talks about the vertex which has leaf labelled $\lambda$ not about the leaf, $\lambda$. I think the argument should be what I said for the 3rd statement
0
0

Related questions