-1

I originally thought it was 0(01)*(01)0 U 1(01)(01)1 where:

  • two versions: one that starts and ends with 0, the other that starts and ends with 1
  • connected by plus, which does not mean union of both but either or
  • repeat of (01)* to make the string even. For example, for 0010 you would
  1. start with 0
  2. pick 0 from the first 01s
  3. pick 0 from the second 01s
  4. end with 0

UPDATE: I think this is a more clear and accurate answer: L=(00+11+01+10)∗(00+11)

  • 00 + 11 +01 + 10: All possible options for an even length

  • 00+ 11: 00 will match either 00 or 01 and 11 will match 11 or 10

cool cat
  • 13
  • 4

1 Answers1

1

Your regex is incorrect since $0011 \in (00+11+01+10)^∗(00+11)$ but $0011 \notin L$. Assuming we only consider words over $\{0, 1\}$, the language is recognised by

$$1\big((0 + 1)(0 + 1)\big)^*1 + 0\big((0 + 1)(0 + 1)\big)^*0$$

and more generally for alphabet $\Sigma$

$$\bigcup_{c \in \Sigma} c(\Sigma\Sigma)^*c.$$

Knogger
  • 1,022
  • 1
  • 11