1 votes 1 votes closed as a duplicate of: GATE CSE 1992 | Question: 02,xviii I want to know logic behind this,thanks in advance. Theory of Computation gateforum-test-series theory-of-computation context-free-language + – smartmeet asked Dec 9, 2016 • retagged Jul 5, 2019 by Cristine smartmeet 375 views comment Share Follow See all 3 Comments See all 3 3 Comments reply Pavan Kumar Munnam commented Dec 9, 2016 reply Follow Share https://gateoverflow.in/576/gate1992_02-xviii 0 votes 0 votes Mehak Sharma 1 commented Dec 9, 2016 reply Follow Share B) 2n-1 In CNF grammar is of the form A -> BC/a which means there will be only two variables on the right hand side of the production or terminal. Now take an example : A --> BC/a B --> b C -->c Generate the string bc using this grammar as : A -->BC --> bC --> bc so 3 steps for the string of length 2. With this all options other than B will be eliminated. Let us take another example : A-->BC/a B-->CD/b C-->DE/c D-->d E-->e Produce string dedde using the above grammar : A -->BC --> CDC --> DEDC --> DEDDE ---> dEDDE --> deDDE --> dedDE --> deddE --> dedde which took 9 steps to produce the string. So in genera it takes n-1 steps to get each variable in the right hand side + n more steps to get the yield. So in total it takes 2n-1 steps. 1 votes 1 votes smartmeet commented Dec 11, 2016 reply Follow Share Thanks! 0 votes 0 votes Please log in or register to add a comment.