Search code examples
regexregular-language

Regular Expression with odd number of 1's and at least one 0


I am designing a regular expression with an odd number of 1's and at least one 0. Set of strings over {0,1}

So far I have this:

0+1(0+10+1)*0+

Is this correct?


Solution

  • The deterministic finite automaton (DFA) would be

    enter image description here

    while following the steps described here, I came up with

    00*1(11)*0*+1(11)*00*