1.

Let L1 = {w ∈ {0,1}∗ | w has at least as many occurrences of (110)’s as (011)’s}.Let L2 = { ∈ {0,1}∗ | w has at least as many occurrences of (000)’s as (111)’s}.Which one of the following is TRUE?(a) L1 is regular but not L2(b) L2 is regular(c) L1 and L2 are regular(d) Neither of them are regularThis question was addressed to me at a job interview.My query is from Minimization of DFA topic in portion Finite Automata and Regular Expression of Compiler

Answer»

Right choice is (a) L1 is regular but not L2

The best EXPLANATION: L1 is regular let us considering the string 011011011011 . Number of times 011 has occurred is 4but also its occurrence is 3. Also if the string is ending with 011we can make a 110 . Now the next string: 110110110110 in this 110 has occurred 4 times and 011 3 times which already satisfy the .



Discussion

No Comment Found

Related InterviewSolutions