6 votes 6 votes L1= Set of all strings having equal number of 00 and 11. L2= Set of all strings having equal number of 01 and 10. (a) Both are Regular (b) Both are Context-Free (c) L1 is regular, L2 is Context Free (d) L1 is CF, L2 is Regular Theory of Computation theory-of-computation regular-language + – Deepak Sharma 1 asked Aug 18, 2015 • retagged Jul 4, 2017 by Arjun Deepak Sharma 1 6.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 13 votes 13 votes L1 is well known Non Regular i.e. (00)^n(11)^n. (Since there is no common character in "00" and "11" we need to keep count of both which is not possible with a finite automata as count can be infinite). L2 is regular and its regular Expression like 0(0+1)*0 + 1(1+0)*1 + 1 + 0 +epsilon. Digvijay Pandey answered Aug 18, 2015 • selected Aug 18, 2015 by Pooja Palod Digvijay Pandey comment Share Follow See all 15 Comments See all 15 15 Comments reply Show 12 previous comments amitqy commented Aug 9, 2018 reply Follow Share can you give an example in which a common character is present and is regular? 0 votes 0 votes Avinash virat commented Oct 12, 2018 reply Follow Share For L2 , according to the given answer it accept string 0, 00 etc. But 0, 00 doesn't belongs to language L2. Then how can we say that L2 is regular. 0 votes 0 votes DarshitGandhi commented Apr 15, 2020 reply Follow Share @Digvijay we cannot generate 01101001 with your regular expression....so i think that it is not a valid regex 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes this prob is solved before . ans will be d) L2 can be considered as all of the stings start and with same elements (0 or 1 ) Pranay Datta 1 answered Nov 6, 2015 Pranay Datta 1 comment Share Follow See 1 comment See all 1 1 comment reply akhil319 commented Mar 24, 2016 reply Follow Share can u share the link, where it was solved previously. 0 votes 0 votes Please log in or register to add a comment.