Prove or disprove: Any infinite subset of the language L = {$a^nb^m$ | n = m or n = 2m} has to be non regular

373 Views Asked by At

I came across two similar types of questions. The first one being:

Prove or disprove: Let L be a language of all the palindromes over the alphabets a,b. Then any infinite subset L1 of L such that every string in L1 contains at least one a and at least one b is also non-regular.

In this case, I think L1 can be regular for L1 = $\{$ $ab^na$ | n $\geq$ 0$\}$.

But for the second question i.e.

Prove or disprove: Any infinite subset of the language L = $\{$ $a^nb^m$ | n = m or n = 2m$\}$ has to be non regular

I think the statement is true as any infinite subset L1 (of L) = $\{a^nb^n \}$ $\cup$ $\{a^{2n}b^n\}$ is always non-regular. But I am not sure how to prove this statement. Is the use of pumping lemma feasible in this scenario? or am I wrong regarding my answer?

1

There are 1 best solutions below

1
On BEST ANSWER
  1. $ab^*a$ is definitely regular.
  2. Pumping lemma is necessary. But the main observation is :

Lemma: Let $L_1 = \{ a^n b^n | n \geq 0 \}$ and $L_2 = \{ a^{2n} b^n | n \geq 0 \}$ s.t. $L = L_1 \cup L_2$. Then any infinite subset $L' \subseteq L$ must have atleast one of $L' \cap L_1 $ or $L' \cap L_2$ to be infinite.

Proof. Trivial by contradiction.

Now suppose $L' \cap L_1$ is infinite. Assume $L'$ be regular with pumping length $p \geq 1$. Let $p_0 = \min_{(a^nb^n \in L' \land n \geq p)}{n}$ ($p_0$ exists as $L' \cap L_1$ is infinite). Then $s =a^{p_0}b^{p_0} \in L'$ and $p_0 \geq p$. Then $|s| \geq p$ and by pumping lemma $a^{k + p_0 -1}b^p_0 \in L' \subseteq L$ forall $k \geq 0$. But this is a contradiction.

Similarly show for the $L' \cap L_2$ case.