Section 2.8

Pumping Lemmas

[20/55%]
Show
LaTeX
Example 2.58

{0p∣p is a prime }\left\{ 0^{p} \mid p\text{ is a prime }\right\} is not a regular language.

?
Example 2.60

{0n1n∣n≥0}\left\{ 0^{n} 1^{n} \mid n \geq 0\right\} is not a regular language.

?
Example 2.61

Show that L={ββR∣β∈{0,1}+}L=\left\{ \beta \beta^{R} \mid \beta \in \left\{ 0,1\right\}^{+}\right\}is not a regular language.

?
Example 2.62

Show that L={ββRγ∣β∈{0,1}+,γ∈{0,1}∗}L=\left\{ \beta \beta^{R} \gamma \mid \beta \in \left\{ 0,1\right\}^{+}, \gamma \in \left\{ 0,1\right\}^{*}\right\} is not regular.

?
Example 2.63

Show that the language L={0n10m10p10q∣n,m,p≥1,q≡nm( mod p)}L=\left\{ 0^{n} 10^{m} 10^{p} 10^{q} \mid n, m, p \geq 1, q \equiv n m(\bmod p)\right\} is not regular.

?
Example 2.64

Consider the following multiplication table on {a,b,c}\left\{ a, b, c\right\} :

×\timesaabbcc
aaaaaacc
bbccaabb
ccbbccaa

Recall, from Example 2.28, that for any string xx in {a,b,c}+\left\{ a, b, c\right\}^{+}, value⁡(x)\operatorname {value}(x) denotes the value obtained by multiplying symbols in xx from left to right. Show that the set

L={xy  :  x,y∈{a,b,c}∗,∣x∣=∣y∣,value⁡(x)=value⁡(y)} L=\left\{ x y \; : \; x, y \in \left\{ a, b, c\right\} ^{*},\left|x\right|=\left|y\right|, \operatorname {value}(x)=\operatorname {value}(y)\right\}

is not regular.

?
Example 2.65

Show that the set LL of all strings over alphabet

Γ={[000],[100],[010],[001],[110],[101],[011],[111]} \Gamma =\left\{ \left[\begin{smallmatrix} 0 \\ 0 \\ 0 \end{smallmatrix}\right],\left[\begin{smallmatrix} 1 \\ 0 \\ 0 \end{smallmatrix}\right],\left[\begin{smallmatrix} 0 \\ 1 \\ 0 \end{smallmatrix}\right],\left[\begin{smallmatrix} 0 \\ 0 \\ 1 \end{smallmatrix}\right],\left[\begin{smallmatrix} 1 \\ 1 \\ 0 \end{smallmatrix}\right],\left[\begin{smallmatrix} 1 \\ 0 \\ 1 \end{smallmatrix}\right],\left[\begin{smallmatrix} 0 \\ 1 \\ 1 \end{smallmatrix}\right],\left[\begin{smallmatrix} 1 \\ 1 \\ 1 \end{smallmatrix}\right]\right\}

that represent correct multiplication is not regular. For example, the relation

00111×010111111 \begin{array}{r} 00111 \\ \times \quad 01011 \\ \hline 1111 \end{array}

implies that the following string is in LL :

[001][011][101][111] \left[\begin{smallmatrix} 0 \\ 0 \\ 1 \end{smallmatrix}\right]\left[\begin{smallmatrix} 0 \\ 1 \\ 1 \end{smallmatrix}\right]\left[\begin{smallmatrix} 1 \\ 0 \\ 1 \end{smallmatrix}\right]\left[\begin{smallmatrix} 1 \\ 1 \\ 1 \end{smallmatrix}\right]
?
Example 2.66

Show that the set L2L_{2} of the binary expansions of the integers in set A={2n∣n≥1}A=\left\{ 2^{n} \mid n \geq 1\right\} is regular, but the set L3L_{3} of the ternary expansions (base 3 representations) of the integers in AA is not regular.

?
Example 2.67

Show that L={w∈{0,1}∗∣#0(w)≠#1(w)}L=\left\{ w \in \left\{ 0,1\right\}^{*} \mid \#_{0}(w) \neq \#_{1}(w)\right\} is not regular.

?
Example 2.68

Show that L={anbmck∣n,m,k≥0,n≠m or m≠k or k≠n}L=\left\{ a^{n} b^{m} c^{k} \mid n, m, k \geq 0, n \neq m\text{ or }m \neq k\text{ or }k \neq n\right\} is not regular.

?
Example 2.69

Let LL be a regular language. Show that

L′={xz∣(∃y)[∣x∣=∣y∣=∣z∣ and xyz∈L]} L^{\prime }=\left\{ x z \mid (\exists y)[\left|x\right|=\left|y\right|=\left|z\right| \text{ and } x y z \in L]\right\}

is not necessarily regular.

?
Problem 2.8.1

Show that the following languages are not regular.

?
(a)

{0n3+3n2−2n∣n≥0}\left\{ 0^{n^{3}+3 n^{2}-2 n} \mid n \geq 0\right\}.

(b)

{0p1q0m1n∣p+q=m+n,p,q,m,n≥0}\left\{ 0^{p} 1^{q} 0^{m} 1^{n} \mid p+q=m+n, p, q, m, n \geq 0\right\}.

(c)

{0m1n∣m,n≥0 and m≠2n+1}\left\{ 0^{m} 1^{n} \mid m, n \geq 0\text{ and }m \neq 2 n+1\right\}.

(d)

{0m1n∣2n≤m≤3n,m,n≥0}\left\{ 0^{m} 1^{n} \mid 2 n \leq m \leq 3 n, m, n \geq 0\right\}.

(e)

{w∈{0,1,2}∗∣#0(w)+#1(w)=#2(w)}\left\{ w \in \left\{ 0, 1, 2\right\}^{*} \mid \#_{0}(w)+\#_{1}(w)=\#_{2}(w)\right\}.

(f)

{0pq∣p and q are primes }\left\{ 0^{p q} \mid p\text{ and }q\text{ are primes }\right\}.

Problem 2.8.2

For each of the following languages, determine whether it is regular. Present a proof for your answer.

?
(a)

The set of binary strings having an equal number of 0 's and 1 's.

(b)

The set of binary strings having an equal number of 01's and 10's.

(c)

The set of binary strings having an equal number of 010's and 101's.

(d)

{xy∣x,y∈{0,1}∗,∣x∣=∣y∣,#0(x)≥#0(y)}\left\{ x y \mid x, y \in \left\{ 0,1\right\}^{*},\left|x\right|=\left|y\right|, \#_{0}(x) \geq \#_{0}(y)\right\}.

(e)

{xyz∣x,y,z∈{0,1}∗,∣x∣=∣z∣>0,#0(x)≥#0(z)}\left\{ x y z \mid x, y, z \in \left\{ 0,1\right\}^{*},\left|x\right|=\left|z\right|>0, \#_{0}(x) \geq \#_{0}(z)\right\}.

(f)

{x#y#z∣x,y,z are binary expansions of positive integers satisfying x+y=z}\left\{ x \# y \# z \mid x, y, z\text{ are binary expansions of positive integers satisfying }x+y=z\right\}.

Problem 2.8.3

Let Γ\Gamma be the alphabet of Example 2.65.

?
(a)

Show that the set LL of all strings over alphabet Γ\Gamma that represent correct division is not regular. For example,

11111×01100100011 \begin{array}{r} 11111 \\ \times \quad 011001 \\ \hline 00011 \end{array}

implies that the following string is in LL :

[100][110][101][111]. \left[\begin{smallmatrix} 1 \\ 0 \\ 0 \end{smallmatrix}\right]\left[\begin{smallmatrix} 1 \\ 1 \\ 0 \end{smallmatrix}\right]\left[\begin{smallmatrix} 1 \\ 0 \\ 1 \end{smallmatrix}\right]\left[\begin{smallmatrix} 1 \\ 1 \\ 1 \end{smallmatrix}\right].
(b)

Show that the set of all strings over Γ\Gamma that represent correct multiplication, with the second multiplier equal to 3, is regular.

Problem 2.8.4

Is it true that for any regular language LL over {0,1}\left\{ 0,1\right\}, the set N(L)={0#0(x)1#1(x)∣x∈L}N(L)= \left\{ 0^{\#_{0}(x)} 1^{\#_{1}(x)} \mid x \in L\right\} is also regular? Prove your answer.

?
Problem 2.8.5

Prove the following stronger form of the pumping lemma: For any regular language LL and any positive integer kk, there exists a positive integer ss such that any string xx in LL with ∣x∣>s\left|x\right|>s can be decomposed into x=uvwx=u v w such that ∣v∣>k\left|v\right|>k and for any i≥0,uviw∈Li \geq 0, u v^{i} w \in L.

?
Problem 2.8.6

Find a regular language LL such that

L^={xz∣(∃y)[∣x∣=∣y∣=∣z∣ and xyzy∈L]} \widehat{L}=\left\{ x z \mid (\exists y)[\left|x\right|=\left|y\right|=\left|z\right| \text{ and } x y z y \in L]\right\}

is not regular.

?
Problem 2.8.7

Let AA and BB be regular sets over alphabet Σ\Sigma. Which of the following languages, if any, are necessarily regular?

?
(a)

{x∣x∈A and xR∈B}\left\{ x \mid x \in A\text{ and }x^{R} \in B\right\}.

(b)

{x∣x∈A and xR∉B}\left\{ x \mid x \in A\text{ and }x^{R} \notin B\right\}.

(c)

{x∣x=xR and x∈A}\left\{ x \mid x=x^{R}\text{ and }x \in A\right\}.

(d)

{a1bna2bn−1a3bn−2⋯anb1∣ai,bi∈Σ for 1≤i≤n,a1a2⋯an∈A,b1b2⋯bn∈B}\left\{ a_{1} b_{n} a_{2} b_{n-1} a_{3} b_{n-2} \cdots a_{n} b_{1} \mid a_{i}, b_{i} \in \Sigma \text{ for }1 \leq i \leq n, a_{1} a_{2} \cdots a_{n} \in A, b_{1} b_{2} \cdots b_{n} \in B\right\}.

(e)

{a1ana2an−1a3an−2⋯ana1∣ai∈Σ for 1≤i≤n, a1a2⋯an∈A}\left\{ a_{1} a_{n} a_{2} a_{n-1} a_{3} a_{n-2} \cdots a_{n} a_{1} \mid a_{i} \in \Sigma \text{ for }1 \leq i \leq n\text{, }a_{1} a_{2} \cdots a_{n} \in A\right\}.

(f)

{a1a2na3a2n−2a5a2n−4⋯a2n−1a2∣ai∈Σ for 1≤i≤2n, a1a2⋯an∈A}\left\{ a_{1} a_{2 n} a_{3} a_{2 n-2} a_{5} a_{2 n-4} \cdots a_{2 n-1} a_{2} \mid a_{i} \in \Sigma \text{ for }1 \leq i \leq 2 n\text{, }a_{1} a_{2} \cdots a_{n} \in A\right\}.

Problem 2.8.8

Consider the language

L={x0ny1nz∣x∈P,y∈Q,z∈R} L=\left\{ x 0^{n} y 1^{n} z \mid x \in P, y \in Q, z \in R\right\}

where P,QP, Q and RR are nonempty sets over alphabet {0,1}\left\{ 0,1\right\}. Can you find regular sets P,Q,RP, Q, R such that LL is not regular? Can you find regular sets P,Q,RP, Q, R such that LL is regular? What if P,Q,RP, Q, R must be infinite regular sets?

?
Problem 2.8.9
?
(a)

Is the language {03m+4n∣m,n≥0}\left\{ 0^{3 m+4 n} \mid m, n \geq 0\right\} regular? Prove your answer.

(b)

Let LL be a language over alphabet {0}\left\{ 0\right\}. Show that L∗L^{*} is regular. [Hint: Prove and use the fact that if aa and bb are relatively prime natural numbers, then for any integer n≥abn \geq a b, there exist nonnegative integers uu and vv such that n=ua+vbn=u a+v b.]