I'm given the following language:

L = {w∈{0,1}* | w ends in 010 and contains 011}

The task is to find a regular expression R that describes this language and prove L = L(R).

I have found the regular expression : ^([011])[01]*010$.

But have no idea how to prove L=L(R)?

  • $\begingroup$ What definition (i.e. syntax and semantics) of "regular expression" are you working with? Your expression doesn't really comply with textbook notations. $\endgroup$ – Shaull Jan 3 '17 at 13:51
  • 1
    $\begingroup$ We have a reference question that covers your problem in detail: cs.stackexchange.com/questions/11315/how-to-show-that-l-lg I strongly recommend you to refrain from using the PCRE notation when talking about regular expressions in a non-programming context. In particular, subpatterns allow to form expressions that can define non-regular languages (not even context-free, in fact.) $\endgroup$ – quicksort Jan 3 '17 at 14:00
  • $\begingroup$ @quicksort That question covers how to prove that a language is produced by some grammar, not how to prove that it matches some regular expression. I suppose one could convert the regular expression to a grammar, first, but that seems like a lot of extra work. $\endgroup$ – David Richerby Jan 3 '17 at 18:31
  • $\begingroup$ @DavidRicherby: You are absolutely right, I'm very sorry. I assume my brain automatically accepted it after seeing "induction". Still, I believe our other reference questions provide a good coverage. $\endgroup$ – quicksort Jan 3 '17 at 19:36

In the expression you propose it seems you require the string to start with 011 rather than have it as an arbitrary substring.

So in my dialect of RegEx the expression would be (0+1)*011(0+1)*010. By definition that would specify all strings of the form $u 011 v 010$ where $u,v$ are arbitrary. This means all those strings have 011 as subword and end in 010.

We also have to explain the converse. That every string with that subword and suffix is covered by the expression. For that it suffices to note that 011 and 010 cannot overlap. So, 010 must come before 011. Which means it is of the form $u 011 v 010$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.