228 views
0 votes
0 votes

I am getting option (D). But answer is given as (B). Please check.

1 Answer

1 votes
1 votes

Answer :Option (B)

Let's Understand this with an example.

Let CFG be,

S -> aSa | bSb | ϵ

Now I took w=aa, 

so, |w|=2, and when you will derive it on pen and paper you will find that m=2

And there will be 5 nodes. a,s,s,a,ϵ.

Option B satisfies this relation as 2*2+2-1=5.

Related questions

1 votes
1 votes
0 answers
1
Mandeep Singh asked Oct 3, 2016
504 views
Number of nodes in the derivation tree when a word of length $2^{k}$ is derived from a grammar in CNF?1. 2^(k+1) – 12. 3*2^k – 13. 2^(k+1) + 14. 3*2^k + 1
0 votes
0 votes
2 answers
2
sripo asked Dec 25, 2018
4,788 views
In a 3-array tree if internal nodes have exactly 3 children,the number of leaf nodes will be __ ?Does it vary for binary tree?What do you mean by internal nodes? Non roo...
0 votes
0 votes
0 answers
3
bekan asked Dec 10, 2018
177 views
That is suppose there are 2 nodes A and B in a given Network topology. Assuming that we assigned the queue length=50packets for each. Let a number of packets are sent to ...
2 votes
2 votes
0 answers
4
junaid ahmad asked Jan 7, 2018
391 views
......