4

Sipser's question 1.63:

Let A be an infinite regular language. Prove that A can be split into two infinite disjoint regular subsets.

Is my solution correct?

Since $A$ is infinite and regular, then the pumping lemma holds. We have a pumping length $p \geq 0$ for this language. We take one word $w$ in $A$ such that $|w| \geq p$, and according to the pumping lemma we split it into $w = xyz$ as in the lemma.

We then define the two languages like this:

$A_1$ contains all the strings $xy^{2i}z, i\geq 0$

$A_2$ contains all the strings $xy^{2i + 1}z, i \geq 0$

That means that $A_1$ contains all the strings that go an even number of times in that cycle, and $A_2$ all the strings that go an odd number of times in that cycle.

We note that we have also covered the words that are not related to the word we split, since $0$ is even.

Is this a correct approach?

TheNotMe
  • 4,841

1 Answers1

8

No, this is not correct, you took one $w$, how do you know $A_1 \cup A_2=L$?

How ever, your idea is pretty close,here is a solution:

Consider $A_1=\{xy^{2k}z\}$ and $A_2=L-A_1$, Clearly $A_1$ is infinite, also $A_2$ is infinite because $\{xy^{2k+1}z\}\subseteq A_2$.

hhsaffar
  • 2,937
  • because $xy^nz, n\geq 0$are all in L, and the ones that are not related to it are also in $A_1$ because $0$ is even and $xz$ are all in $L$. – TheNotMe Nov 30 '13 at 09:06
  • Suppose $L=a^*$, $w=aaaaaaaa$,$x=a$,$y=aaaa$,z=$aa$. Now $A_1 \cup A_2$ just gives $a^{4k+3}$. – hhsaffar Nov 30 '13 at 09:09
  • @TheNotMe Suppose $L=a^*$, $w=aaaaaaaa$,$x=a$,$y=aaaa$,z=$aa$. Now $A_1 \cup A_2$ just gives $a^{4k+3}$. – hhsaffar Nov 30 '13 at 09:11
  • I see.., thanks for the heads up – TheNotMe Nov 30 '13 at 09:11
  • @TheNotMe However, your idea is pretty close, I updated my answer with a solution. – hhsaffar Nov 30 '13 at 10:48
  • How do you define $A_1$ formally in your solution? – TheNotMe Nov 30 '13 at 11:04
  • @TheNotMe Just the way you did in the problem statement, I take a long enough $w$ and partition it like pumping lemma. – hhsaffar Nov 30 '13 at 11:06
  • There is still the argument that $A_1$ and $A_2$ should be regular. If we prove that $A_1$ is regular then so is $A_2$ through complements and what not. But it will be tough for $A_1$ – TheNotMe Nov 30 '13 at 11:09
  • @TheNotMe We can write like this $A_1=x(yy)^*z$ so it is regular. – hhsaffar Nov 30 '13 at 11:11
  • so what if we can write it $A_1 = x(yy)^{*}z$? What does that even mean? that is not a regular exp – TheNotMe Nov 30 '13 at 11:32
  • @TheNotMe $x,y,z$ are strings, so it is a regular expression, and we have even occurrences of $y$ between $x$ and $z$ . – hhsaffar Nov 30 '13 at 11:45
  • @TheNotMe $A_1$ contains all the strings that start with $x$,go an even number of times in that cycle, and end with $z$. $A_2$ is the complement of $A_1$. – hhsaffar Nov 30 '13 at 11:57
  • $A_2$ is not the complement of $A_1$, the complement of $A_1$ has all other strings in $\Sigma^*$ that are not in $A_2$ too. – TheNotMe Nov 30 '13 at 13:34
  • @TheNotMe You are right, I am talking about $A_1$ and $A_2$ in my solution. I meant $A_2$ is $A_1$'s complement with respect to $L$, or simply $L-A_1$ – hhsaffar Nov 30 '13 at 14:40