Proving languages are not regular.

  • MHB
  • Thread starter JamesBwoii
  • Start date
  • Tags
    Regular
In summary: So, if $xy^iz\in L$ for all $i$, then $|xz|+i|y|$ must equal $2^k$ for some $k$, and this should hold for all $i$. But this is impossible because the distance between neighboring powers of two increases as the powers increase.
  • #1
JamesBwoii
74
0
Hi, I am struggling with the concept of proving languages are not regular. I know that I need to use pumping lemma to prove it by contradiction but I can't get my head around it.

Here is one language that I need to prove is not regular.

http://i.imgur.com/quD26In.png

I know that is essentially saying:

a^2^n such that n is greater than or equal 0 is a subset of a*

I know for a language to be regular there exists an integer n > 0 such that any word \in L with \left| w \right| > n can be represented as w = xyz where y \ne\epsilon, \left| xy \right|> n and x{y}^{i}z \in L for all i \ge 0.From there I don't know where to go.

Thanks!
 
Physics news on Phys.org
  • #2
Please enclose your LaTeX code in \$...\$ or [math]...[/math] tags. Also, you can use [img]URL[/img] to insert images, or you can upload them from your computer. The "Insert Image" button in the second row of the toolbar opens a dialog asking you for a URL or a file name.

The idea is that if a language $L$ is regular, then the set $\{|w|:w\in L\}$ contains an arithmetic progression. (This fact is weaker than the pumping lemma.) This is because $xy^iz\in L$ for all $i$ and $|xy^iz|=|xz|+i|y|$. You need to show that $\{2^n:n\in\Bbb N\}$ does not contain an arithmetic progression because the distance between neighboring elements increases.
 
  • #3
I'm still a bit confused. I think the bit I can't do is picking the string to pump with and then put it equal to xyz.

I guess what I am asking is how do I know what string to use?
 
  • #4
JaAnTr said:
I guess what I am asking is how do I know what string to use?
The pumping lemma says that if a language is regular, then there exists a number $p$ (pumping length) and all words in the language longer than $p$ can be broken in such a way that some property holds. To prove that a language is not regular, you show that the conclusion is false. That is, you show that for every number $p$ there exists a word in the language longer than $p$ that cannot be broken to satisfy the property.

In this case, it does not really matter which word to choose as long as it is longer than $p$ and is in the language (these properties are required to refute the conclusion). No word of the form $a^{2^n}$ can be represented as $xyz$ in such a way that $xy^iz\in L$ for all $i$. Otherwise, for each $i$ the number $|xz|+i|y|$ would equal $2^k$ for some $k$, which is impossible.

By the way, there is a typo in your statement of the pumping lemma in post #1.
JaAnTr said:
I know for a language to be regular there exists an integer $n > 0$ such that any word $\in L$ with $\left| w \right| > n$ can be represented as $w = xyz$ where $y \ne\epsilon$, $\left| xy \right|> n$ and $x{y}^{i}z \in L$ for all $i \ge 0$.
It should say $\left| xy \right|\le n$, not $\left| xy \right|> n$.

You may find https://driven2services.com/staging/mh/index.php?threads/8355/ useful. It is a about context-free, rather than regular, languages, but the logic of the pumping lemma is the same.
 
  • #5
I've read through the link and your post and I think I'm getting there. However, I don't fully understand what you've done here.
Evgeny.Makarov said:
No word of the form $a^{2^n}$ can be represented as $xyz$ in such a way that $xy^iz\in L$ for all $i$. Otherwise, for each $i$ the number $|xz|+i|y|$ would equal $2^k$ for some $k$, which is impossible.

I understand the first sentence, but I don't know how you've worked out the bottom bit. I don't get how $xy^iz\in L$ has become $|xz|+i|y|$. How was the $i$ moved from the $y^i$ to $i|y|$. Also where has K come from?

Thanks as always!
 
  • #6
Evgeny.Makarov said:
No word of the form $a^{2^n}$ can be represented as $xyz$ in such a way that $xy^iz\in L$ for all $i$. Otherwise, for each $i$ the number $|xz|+i|y|$ would equal $2^k$ for some $k$, which is impossible.

JaAnTr said:
I understand the first sentence, but I don't know how you've worked out the bottom bit. I don't get how $xy^iz\in L$ has become $|xz|+i|y|$. How was the $i$ moved from the $y^i$ to $i|y|$. Also where has K come from?
Let's recall the notations used in this thread.
  • $L=\{a^{2^n}:n\in\Bbb N\}$.
  • $y^i$ denotes the concatenation of $i$ copies of $y$, in particular,
  • $a^{2^n}$ is a word consisting of $2^n$ symbols $a$.
  • $|w|$ is the length of $w$.
Thus, for all $w\in\{a\}^*$ we have $w\in L\iff |w|=2^k$ for some $k$. Also, $|xy^iz|=|x|+|y^i|+|z|=(|x|+|z|)+i|y|=|xz|+i|y|$.
 

Related to Proving languages are not regular.

1. What is a regular language?

A regular language is a type of formal language that can be described by a regular expression or finite automaton. It is a set of strings that can be recognized by a finite state machine.

2. How can we prove that a language is not regular?

One way to prove that a language is not regular is by using the pumping lemma, which states that if a language is regular, then there exists a constant number (called the pumping length) where any string longer than that length can be divided into smaller parts that can be repeated an infinite number of times to produce other strings in the language. If this is not possible, then the language is not regular.

3. What is the difference between a regular language and a context-free language?

A context-free language is a type of formal language that can be described by a context-free grammar, which allows for more complex rules and structures than a regular expression. Regular languages are a subset of context-free languages, meaning that all regular languages are also context-free, but not all context-free languages are regular.

4. Can a language be both regular and non-regular?

No, a language cannot be both regular and non-regular. A language is either regular or non-regular, based on its properties and the rules that define it. However, it is possible for a language to be regular in one context (such as with a specific alphabet or set of rules) and non-regular in another context.

5. How is proving a language is not regular useful?

Proving that a language is not regular can be useful for understanding the limitations and capabilities of regular expressions and finite automata. It can also help identify more complex patterns and structures that may require a different type of formal language to describe. In addition, it can be used as a tool for analyzing and categorizing different types of languages.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
24
Views
4K
  • Programming and Computer Science
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top