• retagged by
3,254 views

2 Answers

0 0 votes
first lets let what are the basic properties of a CNF, say G={V,T,S,P}

1) production is in the form A->x or A->BC (where A,B,C are non terminals and x is a terminal)

2) whenever we say derivation we either mean left most derivation or right most...not haphazardly..

 

 

 

ANSWER FOR PART 1=>

 now it's intuitive that we can write a production of CNF like below---

P->Q where P belongs to V

         and Q belongs to T or Q is MN (M,N belongs to V)

so we can see its obvious that when we derive one sentential form from the previous one we either increment the number of non ternimals or we change one non terminal by a terminal.

say string length is |w| then from S (i.e. start symbol) we grow it to the length of |w| non ternimals and then one by one convert each non terminal to a terminal

so now at the start we have one length sentential form i.e. S

then we grow it to |w| and it takes |w|-1 rounds

at this time we have a all non terminal sentential form of length |w|

now we one by one change the non ternimals to terminals..

this takes more |w| rounds or steps..

so for a string of length |w| it requires 2×|w| - 1 rounds or steps to derive the string..

here u have given tree height h so

2*x-1=h

=>x=(h+1)/2

this is the maximum yield.

 

 

 

 

 

ANSWER FOR 2ND PART=>

for CNF as it has constraints over production as mentioned before its always 2*n-1 steps to get or to derive a string of length n

so max and min steps are both 2*n-1
Position:
Show:

Related questions

1 1 vote
0 0 answers
5.7k
5.7k views
learner_geek asked Aug 5, 2017
5,675 views
Is it mandatory in GNF that first element in production must be terminal(I am considering there is no Left recursion)Is it mandatory in CNF that in production only two no...
1 1 vote
0 0 answers
2.0k
2.0k views
learner_geek asked Aug 5, 2017
1,981 views
Given answer is (a) but L->AB i think it is wrong because A and B produce something else Previously, so instead of L->AB there would have given like L->MN M->c1 and N->S ...
0 0 votes
2 2 answers
2.0k
2.0k views
1 1 vote
0 0 answers
5.7k
5.7k views
Manu Thakur asked Oct 13, 2017
5,692 views
Convert the following context free grammar into Chomsky Normal Form:$S \rightarrow ASA | aB$$A \rightarrow B | S$$B \rightarrow b | \epsilon$Does the appearance of start...