0

Today I had a couple of formal language lectures. The Instructor wrote a regular expression for the alphabet $\{0,1\}$ which does not include any string which includes "11" as a substring.

She wrote that regular expression: $0^*\cup 0^*1(00^*1)^*0^*$. I have nothing against that but after the lecture I tried to solve that problem on my own and came up with that expression: $0^*\cup0^*(100^*)^*0^*$.

Is that true? It appears to me that I can even get rid of $0^*$ at the end of expression and simplify as $0^*\cup0^*(100^*)^*$.

John L.
  • 38,985
  • 4
  • 33
  • 90
  • 1
    The regexp attributed to your instructor can't generate $10101$, for example. Your result appears to be fine. There are many regular expressions that correspond to the same language. Welcome to the site. – Rick Decker Feb 10 '20 at 18:31
  • @RickDecker since I am new to the site , I couldn't write the expression the expression wrote properly. At the end there is zero to kleene star , so I guees it can now generate 10101 . Thanks for the comment and welcoming :) – no one ever Feb 10 '20 at 18:42
  • For later use, the asterisk (or star, or $*$) has a special meaning here, so to get one to appear as it should, one way is to enclose a mathematical expression in dollar signs, like [dollar sign][asterisk][dollar sign] – Rick Decker Feb 10 '20 at 18:52
  • @RickDecker I will keep that in mind :) – no one ever Feb 10 '20 at 20:40
  • Your solution cannot generate for example 0000001. It insists that a 1 must be followed by zeroes. – gnasher729 Feb 10 '20 at 21:44

0 Answers0