1 votes 1 votes S→ A 0B A→ BB|0 B →AA|1 What is the number of terminal strings of length 5 generated by the context-free grammar shown above? 4 5 6 7 Compiler Design compiler-design context-free-grammar + – sh!va asked Jul 12, 2016 • edited Jul 2, 2022 by Lakshman Bhaiya sh!va 1.1k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply asu commented Jul 13, 2016 reply Follow Share ANS 5 0 votes 0 votes sh!va commented Jul 13, 2016 reply Follow Share How to solve this? 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes JUST GO WITH USUAL MANNER: 1. S-->A0B-->BB0AA-->11000. 2.S-->A0B-->BB0B-->AAB0B OR BAA0B -->00101 OR 10001(TWO STRINGS) 3. S-->A0B-->A0AA-->A0ABB OR A0BBA --> 00011 OR 00110 (TWO STRINGS) TOTAL 5 STRINGS asu answered Jul 13, 2016 asu comment Share Follow See all 2 Comments See all 2 2 Comments reply sh!va commented Jul 13, 2016 reply Follow Share manual solution is difficult if number of terminals in strings is more.. Is there any other way to solve this, if possible? 0 votes 0 votes asu commented Jul 13, 2016 reply Follow Share I TOLD MANUALLY BUT I APPLIED SHORTCUTS ONLY IN 2. IN PLACE OF BB .YOU CAN GO IN TWO WAY THAT IS FIX FIRST B THEN EXPAND OTHER OR EXPAND FIRST B AND FIX OTHER 1 votes 1 votes Please log in or register to add a comment.
3 votes 3 votes Answer : 5 shekhar chauhan answered Jul 13, 2016 shekhar chauhan comment Share Follow See all 0 reply Please log in or register to add a comment.