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

$$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?

• 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? – Apass.Jack Feb 10 at 17:20
• @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 – PoliteMan Feb 10 at 17:27

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 \}$$
$$(0+ 1 + 2) ^ {*} (00 + 11 + 22 + 0101 + 1010 + 0202 + 2020 + 1212 + 2121)(0 + 1 + 2) ^ {*}$$