0 votes 0 votes Theory of Computation theory-of-computation context-free-language + – Abhijeet_Kumar asked Dec 25, 2017 Abhijeet_Kumar 592 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply joshi_nitish commented Dec 25, 2017 i edited by joshi_nitish Dec 25, 2017 reply Follow Share above grammar is generating palindromic strings, so problem is to find all palindromes over {0,1} from length 1 to 7. $2+2+2.2+2.2+2.2.2+2.2.2+2.2.2.2=44$ 44 is answer (epsilon is excluded) 2 votes 2 votes Abhijeet_Kumar commented Dec 25, 2017 reply Follow Share please elaborate 0 votes 0 votes joshi_nitish commented Dec 25, 2017 reply Follow Share see it is generating all the palindromic strings.. CASE1: for even length strings upto left half ($\frac{n}{2}$) you have 2 choices for each bit, but for right half there is no choice CASE2: for odd length string upto ($\frac{n+1}{2}$) only you have choice for every bit 0 votes 0 votes Ajay Jadhav commented Dec 25, 2017 reply Follow Share for even length string e.g 4 = first 2 will have 2 choices each 2x2 and last 2 will have 1 choices each i.e 1x1 In case of odd length e.g 5, first 2 will have 2 choices each 2x2 middle element will have 2 choices also and last two will have 1 choices each in order to follow palindrome. 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes Is ans 54 hemsagarsharma answered Dec 25, 2017 hemsagarsharma comment Share Follow See all 2 Comments See all 2 2 Comments reply Harsha896 commented Dec 25, 2017 reply Follow Share Iam getting 44 0 votes 0 votes Abhijeet_Kumar commented Dec 25, 2017 reply Follow Share 44 is right answer how??? 0 votes 0 votes Please log in or register to add a comment.