Section 5.6

Undecidable Problems

[12/50%]
Show
LaTeX
Example 5.41

Show that the following problems are undecidable:

?
(a)

Given a DTM M and a string yy, determine whether MM halts on some input zz which is greater than or equal to yy.

(b)

Given two DTM's MxM_{x} and MyM_{y}, determine whether they are equivalent (i.e., whether they compute the same function).

(c)

Given a DTM MM, an input yy and a state qiq_{i} of MM, determine whether MM ever enters state qiq_{i} in the computation on input yy.

(d)

Given a DTM M, determine whether the computation of M(111) contains a configuration in which the tape contains a substring 000.

Example 5.42

Show that the following problems are undecidable:

?
(a)

Given a grammar GG and a string xx, determine whether x∈L(G)x \in L(G).

(b)

Given a grammar GG and two strings xx and yy, determine whether x→G∗yx \xrightarrow [G]{*} y.

(c)

Given a grammar GG and two strings x,y∈L(G)x, y \in L(G), determine whether there is a derivation of xx that is longer than the shortest derivation of yy. (The length of a derivation is the number of sentential forms in the derivation.)

(d)

Given a grammar GG, determine whether L(G)=∅L(G)=\emptyset.

(e)

Given two grammars G1G_{1} and G2G_{2}, determine whether L(G1)⊆L(G2)L\left(G_{1}\right) \subseteq L\left(G_{2}\right).

(f)

Given a grammar GG, determine whether L(G)L(G) is a context-free language (i.e, for a given unrestricted grammar GG, determine whether there is an equivalent context-free grammar).

Example 5.43

Show that the problem of determining whether a given context-free grammar GG over the alphabet {0,1}\left\{ 0,1\right\} has L(G)={0,1}∗L(G)= \left\{ 0,1\right\}^{*} is undecidable.

?
Example 5.45

Prove that the problem PCP is undecidable (with respect to some alphabet Σ\Sigma).

?
Example 5.46

Prove that the problem of determining whether two given context-free grammars G1G_{1} and G2G_{2} have the property L(G1)∩L(G2)=∅L\left(G_{1}\right) \cap L\left(G_{2}\right)=\emptyset is undecidable.

?
Example 5.47

Prove that the problem of determining whether a given context-free grammar GG is ambiguous is undecidable.

?
Problem 5.6.1

For each of the following problems about Turing machines, determine whether it is decidable or not:

?
(a)

Given a one-way, one-tape DTM MM (defined in Section 4.1) and a string xx, determine whether the tape head of MM will ever visit the (2n)(2 n) th cell in the computation of MM on input xx, where n=∣x∣n=\left|x\right| (we call the leftmost cell of the tape the 0th cell, and the one to its right the first cell, etc.).

(b)

Given a two-way, one-tape DTM MM (defined in Section 4.3) and a string xx, determine whether the tape head of MM will ever visit the (2n)(2 n) th cell in the computation of MM on input xx, where n=∣x∣n=\left|x\right| (we call the cell holding the leftmost symbol of xx the first cell, and the cell to its right the second cell, etc.).

(c)

Given a two-way, one-tape DTM MM and a string xx, determine whether the tape head of MM will move left for more than nn times (not necessarily in consecutive moves) in the computation of MM on input xx, where n=∣x∣n=\left|x\right|.

(d)

Given a two-way, one-tape DTM MM whose tape symbol set is Γ={a,b, B}\Gamma =\left\{ a, b, \mathrm{~ B}\right\} and a string x∈{a,b}∗x \in \left\{ a, b\right\}^{*}, determine whether MM will ever overwrite a symbol aa by a symbol bb in its computation on input xx.

(e)

Given two DTM's M1M_{1} and M2M_{2} and two strings x1x_{1} and x2x_{2}, determine whether it is true that sometime during the computation of M1M_{1} on input x1x_{1} and the computation of M2M_{2} on input x2x_{2}, the first three cells of their tapes contain the same symbols (i.e., whether there is a configuration α\alpha of the computation of M1(x1)M_{1}\left(x_{1}\right) and a configuration β\beta of the computation of M2(x2)M_{2}\left(x_{2}\right) such that the first three tape symbols of α\alpha is the same as those of β\beta).

Problem 5.6.2

For each of the following problems about unrestricted grammars, determine whether it is decidable or not:

?
(a)

Given a grammar GG over the alphabet {a,b,c}\left\{ a, b, c\right\}, determine whether L(G)L(G) contains a string xx of which aaa occurs as a substring.

(b)

Given a grammar GG and a string x∈L(G)x \in L(G), determine whether there is a derivation of xx that does not contain a sentential form in which aAaa A a occurs as a substring, where aa is a terminal symbol and AA is a nonterminal symbol in GG.

(c)

Given a grammar GG and a string x∈L(G)x \in L(G), determine whether there is a derivation of xx in which the lengths of the sentential forms do not decrease.

(d)

Given a grammar GG and a string x∈L(G)x \in L(G), determine whether there is a derivation of xx in which the lengths of the sentential forms decrease at most nn times, where n=∣x∣n=\left|x\right|.

Problem 5.6.3

Complete the details of the PDA M1M_{1} of Example 5.43. That is, construct a PDA M2M_{2} which accepts the set {xy∣x and y are two legal configuration codes of M, and neg⁡(x⊢yR)}\left\{ x y \mid x \text{ and } y \text{ are two legal configuration codes of } M \text{, and } \operatorname {neg}\left(x \vdash y^{R}\right)\right\}.

?
Problem 5.6.4

For each of the following problems about context-free grammars, determine whether it is decidable or not:

?
(a)

Given a context-free grammar GG and a DFA MM, determine whether L(G)⊆L(M)L(G) \subseteq L(M).

(b)

Given a context-free grammar GG and a DFA MM, determine whether L(M)⊆L(G)L(M) \subseteq L(G).

(c)

Given a context-free grammar GG, determine whether L(G)L(G) is regular.

(d)

Given a context-free grammar GG, determine whether the complement of L(G)L(G) is context-free.

(e)

Given two context-free grammars G1G_{1} and G2G_{2}, determine whether L(G1)∩L(G2)L\left(G_{1}\right) \cap L\left(G_{2}\right) is context-free.

Problem 5.6.5

For each of the following variations of PCP, determine whether it is decidable or not:

?
(a)

The problem PCP over the alphabet Σ={1}\Sigma =\left\{ 1\right\}.

(b)

The problem PCP over the alphabet Σ={0,1}\Sigma =\left\{ 0,1\right\}.

(c)

Given a finite set of ordered pairs (x1,y1),…,(xn,yn)\left(x_{1}, y_{1}\right), \ldots ,\left(x_{n}, y_{n}\right) of strings in Σ∗\Sigma^{*}, determine whether there is an infinite sequence (i1,i2,…)(i_{1}, i_{2}, \ldots ) of integers in {1,…,n}\left\{ 1, \ldots , n\right\} such that xi1xi2⋯=yi1yi2⋯x_{i_{1}} x_{i_{2}} \cdots =y_{i_{1}} y_{i_{2}} \cdots.

(d)

Given a finite set of ordered pairs (x1,y1),…,(xn,yn)\left(x_{1}, y_{1}\right), \ldots ,\left(x_{n}, y_{n}\right) of strings in Σ∗\Sigma^{*}, determine whether there exist two sequences of integers (i1i_{1}, i2,…,ik)\left.i_{2}, \ldots , i_{k}\right) and (j1,j2,…,jℓ)\left(j_{1}, j_{2}, \ldots , j_{\ell }\right), with each element belonging to {1, …,n}\left\{ 1\text{, }\ldots , n\right\}, such that xi1xi2⋯xik=yj1yj2⋯yjjx_{i_{1}} x_{i_{2}} \cdots x_{i_{k}}=y_{j_{1}} y_{j_{2}} \cdots y_{j_{j}}.

(e)

The same question as (d) above, except that the two sequences of integers must be of the same size, that is, k=ℓk=\ell.

Problem 5.6.6

In this question, we consider the tiling problem. In this problem, a colored tile is a square tile of size 1×11 \times 1 whose four sides are colored by colors selected from a finite set CC. The four sides of a colored tile is clearly marked to be the up, down, left and right sides. Two colored tiles can be put in the plane next to each other if the two neighboring sides have the same color.

Tiling. Given a finite number of types t0,t1,…,tnt_{0}, t_{1}, \ldots , t_{n} of colored tiles, determine whether it is possible to cover the first quadrant of the plane by colored tiles of these types (with infinite supply of the tiles of each type), starting with a tile of type t0t_{0} at the lower left corner (see Figure 5.6).

Figure 5.6: The problem Tiling (c 1, \ldots , c 4 denote four colors of tile t_{0}).Figure 5.6: The problem Tiling (c 1, \ldots , c 4 denote four colors of tile t_{0}).

Show that the problem Tiling is undecidable.

?