1
$\begingroup$

Is the language {xyx, where x,y are arbitrary strings over {0,1}} a regular set?

I'm not sure on this, but I think it is regular. Let $x=\epsilon$ then $xyx=y$ and $y=\{0,1\}^*$.

New contributor
Elijah Heimsoth is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$

1 Answer 1

3
$\begingroup$

Yes, the language is regular and your idea is correct.

You can formally prove it by showing that $L = \{xyx \mid x,y \in \{0,1\}^*\}$ is equivalent to the language $\{0,1\}^*$, which is clearly regular.

By definition, we have that $L \subseteq \{0,1\}^*$ since every language is a subset of the set of all strings (over the same alphabet). To prove that $\{0,1\}^* \subseteq L$, consider any string $w \in \{0,1\}^*$. Then, we have that $w = \varepsilon w \varepsilon$, concluding that $w \in L$. Therefore, $L = \{0,1\}^*$.

New contributor
Simone Bianco is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
2
  • $\begingroup$ What about expecting the string represented by the left $x$ to be the same as the one represented by the right $x$? $\endgroup$ Commented 5 hours ago
  • $\begingroup$ @greybeard Every word of the form $x_1 y_1 x_1$ where $x_1 \neq \varepsilon$ can also be written as $x_2 y_2 x_2$ where $x_2 = \varepsilon$ and $y_2 = x_1 y_1 x_1$, which is basically the sentence before last of Simone Bianco's answer. $\endgroup$ Commented 2 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.