MHB Show that the language is not context-free with the Pumping Lemma

  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Language
AI Thread Summary
The discussion focuses on demonstrating that the language L = {m^(x): m is a symbol and x is a perfect square} is not context-free using the Pumping Lemma. The initial assumption is that L is context-free, leading to the identification of a pumping length p. The key argument revolves around showing that for any i, the expression p + i|vy| cannot consistently yield a perfect square, as the arithmetic progression of perfect squares cannot be maintained. A detailed proof is suggested, using properties of arithmetic progressions to conclude that not all terms can be perfect squares. This approach solidifies the argument that L is not context-free.
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hello! :o

Given the language $L$=$\{m^{(x)}: m$ is a symbol and $x$ is a perfect square$\}$, I have to show that L is not context-free using the Pumping Lemma.

First, we assume that L is context-free. So, from the pumping lemma there is a pumping length $p$. Let $s=m^{(p)}$, that can be divided into $uvxyz$.

How can I continue? How can I find something so that I can conclude that one of the conditions of Pumping Lemma is not satisfied?
Conditions of Pumping Lemma:
1) $ \forall i\geq 0$ $uv^ixy^iz$ $\epsilon$ $L$
2) $ |vy|>0$
3) $|vxy| \leq p$
 
Technology news on Phys.org
mathmari said:
How can I continue? How can I find something so that I can conclude that one of the conditions of Pumping Lemma is not satisfied?
Conditions of Pumping Lemma:
1) $ \forall i\geq 0$ $uv^ixy^iz$ $\epsilon$ $L$
2) $ |vy|>0$
3) $|vxy| \leq p$
This fact requires the simplest version of the pumping lemma, where $|vxy| \leq p$ is not mentioned. The most important thing is that $uv^ixy^iz\in L$ and $|vy|>0$. That is, you can add $i|vy|$ to the length of $s$ for any $i\in\mathbb{N}$ and still stay in the language. Since $s\in L$, $p$ is a perfect square. Then so is $p+i|vy|$ for any $i$. You just need to show that such arithmetic progression cannot consists of perfect squares only. This fact can be proved using high school algebra.
 
Evgeny.Makarov said:
This fact requires the simplest version of the pumping lemma, where $|vxy| \leq p$ is not mentioned. The most important thing is that $uv^ixy^iz\in L$ and $|vy|>0$. That is, you can add $i|vy|$ to the length of $s$ for any $i\in\mathbb{N}$ and still stay in the language. Since $s\in L$, $p$ is a perfect square. Then so is $p+i|vy|$ for any $i$. You just need to show that such arithmetic progression cannot consists of perfect squares only. This fact can be proved using high school algebra.

I got it!
To show that $p+i|vy|$ is not a perfect square for any $i$, I have thought the following:
for $i=0$: p is a perfect square
for $i>0$: Since p is a perfect square, $p=w^2$. If $p+i|vy|$ is also a perfect square, then $w^2+i|vy|=n^2$ $\Rightarrow$ $i|vy|=n^2-w^2$ $\Rightarrow$ $i=\frac{n^2-w^2}{|vy|}$, but that is not always a number in $\mathbb{N}$. So, $p+i|vy|$ is not a perfect square for any $i$.
 
mathmari said:
To show that $p+i|vy|$ is not a perfect square for any $i$
Out of context, I would interpret this as saying that for all $i$, the number $p+i|vy|$ is not a perfect square (which does not have to be true). It's better to say, "$p+i|vy|$ is not a perfect square for some $i$" or "$p+i|vy|$ cannot a perfect square for all $i$".

mathmari said:
I have thought the following:
for $i=0$: p is a perfect square
for $i>0$: Since p is a perfect square, $p=w^2$. If $p+i|vy|$ is also a perfect square, then $w^2+i|vy|=n^2$ $\Rightarrow$ $i|vy|=n^2-w^2$ $\Rightarrow$ $i=\frac{n^2-w^2}{|vy|}$, but that is not always a number in $\mathbb{N}$.
The last sentence is true, but it is not obvious at the level we are working here. (Of course if this were the remaining step to prove Fermat's last theorem, we could say that it is obvious.) I would recommend making this argument more detailed.
 
Evgeny.Makarov said:
Out of context, I would interpret this as saying that for all $i$, the number $p+i|vy|$ is not a perfect square (which does not have to be true). It's better to say, "$p+i|vy|$ is not a perfect square for some $i$" or "$p+i|vy|$ cannot a perfect square for all $i$".

The last sentence is true, but it is not obvious at the level we are working here. (Of course if this were the remaining step to prove Fermat's last theorem, we could say that it is obvious.) I would recommend making this argument more detailed.

How could I make it more detailed?
 
Here is one way. Let $a,d$ be positive integers. It is sufficient to prove that an arithmetic progression $a+kd$, $k\in\mathbb{N}$, cannot consist exclusively of perfect squares. Take $k=d$ and suppose that $a+kd=a+d^2=n^2$ for some positive integer $n$. Then $n>d$, so $(n+1)^2-n^2=2n+1>2d+1>d$. That is, the next perfect square is greater than $a+(k+1)d$, which, therefore, cannot be a perfect square.
 
Evgeny.Makarov said:
Here is one way. Let $a,d$ be positive integers. It is sufficient to prove that an arithmetic progression $a+kd$, $k\in\mathbb{N}$, cannot consist exclusively of perfect squares. Take $k=d$ and suppose that $a+kd=a+d^2=n^2$ for some positive integer $n$. Then $n>d$, so $(n+1)^2-n^2=2n+1>2d+1>d$. That is, the next perfect square is greater than $a+(k+1)d$, which, therefore, cannot be a perfect square.

Thanks a lot! :o
 

Similar threads

Replies
13
Views
3K
Replies
16
Views
5K
Replies
1
Views
1K
Replies
6
Views
2K
Replies
2
Views
2K
Replies
1
Views
3K
Replies
15
Views
4K
Replies
2
Views
2K
Back
Top