0
$\begingroup$

$ L = \{xyyz\in\{0,1,2\}^{*} : y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}} |y|_a \equiv 0 \}$

I think this languages is regular. I write regular expression: $(1 + 2 + 0) ^ {*} (11 + 22 + 1212 + 2121) (1 + 2 + 0) ^ {*} \cup (1 + 2 + 0) ^ {*} (11 + 00+ 1010 + 0101) (1 + 2 + 0) ^ {*} \cup (1 + 2 + 0) ^ {*} (00 + 22 + 0202 + 2020) (1 + 2 + 0) ^ {*}$

Can someone check out my answer?

$\endgroup$
  • $\begingroup$ It looks like you have an endless stream of interesting questions on regular-languages. Can you add a link to your source in the question? $\endgroup$ – Apass.Jack Feb 10 at 17:20
  • $\begingroup$ @Apass.Jack There is no source/link. These are exam tasks from previous years, so I want to do them well. That's why i have so many question because I want solve this kind of task. Do you think my regular expression is good? It is L1 union L2 union L3 so i think languages L is regular $\endgroup$ – PoliteMan Feb 10 at 17:27
1
$\begingroup$

Slight more formally, we have $$ L = \{xyyz : x,y,z\in\{0,1,2\}^{*} \wedge y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}}\,|y|_a = 0 \}$$

Yes, your regular expression is correct. It can be made simpler.

$(0+ 1 + 2) ^ {*} (00 + 11 + 22 + 0101 + 1010 + 0202 + 2020 + 1212 + 2121)(0 + 1 + 2) ^ {*}$

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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