retagged by
1,425 views
0 votes
0 votes

Let G be the CFG, l be the number of left most derivations, r be the number of right most derivations and P be the number of parse trees. Assume l , r and P are computed for a particular string. For a given CFG ‘G’ and given string ‘w’, what is the relation between l , P , r ?

A

l ≤ P ≥ r

B

l = P = r

C

l ≥ P ≤ r

D

none of these

retagged by

1 Answer

0 votes
0 votes
for an unambiguous cfg the no. of parse tree==no. of lmd==no. of rmd==1; therefore for that B will be correct

but for ambiguous cfg the no of parse tree >=no. of rmd and alo with the lmd then ans will be A

but in the question it is not given clearly therefore the answer will be B only becoz it is the most expected ans we consider cfg as unambiguous only

Related questions

0 votes
0 votes
2 answers
2
Rustam Ali asked Sep 3, 2018
891 views
Find time complexity of below Program?A(n){if(n<=1) return;elsereturn $A(\sqrt{n})$ ;}
2 votes
2 votes
1 answer
3
Rishav Kumar Singh asked Jun 15, 2018
2,889 views
Which data structure is most efficient to find the top 10 largest items out of 1 million items stored in file?AMin heapBMax heapCBSTDSorted array
1 votes
1 votes
1 answer
4
Jason_Roy asked Feb 4, 2017
768 views
Can anyone solve this??Doubts: Branch penalty should be 2. right?and what is the branch penalty for unconditional branch?