Section 5.2

Problems

[28/100%]
Show
LaTeX
Problem 5.9

Let T={⟨M⟩∣M is a TM that accepts wR whenever it accepts w}T=\left\{ \langle M\rangle \mid M \text{ is a TM that accepts } w^{\mathcal{R}} \text{ whenever it accepts } w\right\}. Show that TT is undecidable.

?
Problem 5.10

ᴬ Consider the problem of determining whether a two-tape Turing machine ever writes a nonblank symbol on its second tape when it is run on input ww. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.11

ᴬ Consider the problem of determining whether a two-tape Turing machine ever writes a nonblank symbol on its second tape during the course of its computation on any input string. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.12

Consider the problem of determining whether a single-tape Turing machine ever writes a blank symbol over a nonblank symbol during the course of its computation on any input string. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.13

A useless state in a Turing machine is one that is never entered on any input string. Consider the problem of determining whether a Turing machine has any useless states. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.14

Consider the problem of determining whether a Turing machine MM on an input ww ever attempts to move its head left when its head is on the left-most tape cell. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.15

Consider the problem of determining whether a Turing machine MM on an input ww ever attempts to move its head left at any point during its computation on ww. Formulate this problem as a language and show that it is decidable.

?
Problem 5.16

Let Γ={0,1,⊔}\Gamma =\left\{ 0,1, \sqcup \right\} be the tape alphabet for all TMs in this problem. Define the busy beaver function BB⁡:N⟶N\operatorname {BB}: \mathcal{N} \longrightarrow \mathcal{N} as follows. For each value of kk, consider all kk-state TMs that halt when started with a blank tape. Let BB⁡(k)\operatorname {BB}(k) be the maximum number of 1s that remain on the tape among all of these machines. Show that BB⁡\operatorname {BB} is not a computable function.

?
Problem 5.17

Show that the Post Correspondence Problem is decidable over the unary alphabet Σ={1}\Sigma =\left\{ 1\right\}.

?
Problem 5.18

Show that the Post Correspondence Problem is undecidable over the binary alphabet Σ={0,1}\Sigma =\left\{ 0,1\right\}.

?
Problem 5.19

In the silly Post Correspondence Problem, SPCP, the top string in each pair has the same length as the bottom string. Show that the SPCP is decidable.

?
Problem 5.20

Prove that there exists an undecidable subset of 1*.

?
Problem 5.21

Let AMBIG⁡CFG={⟨G⟩∣G is an ambiguous CFG }\operatorname {AMBIG}_{\mathrm{CFG}}=\left\{ \langle G\rangle \mid G\text{ is an ambiguous CFG }\right\}. Show that AMBIG⁡CFG\operatorname {AMBIG}_{\mathrm{CFG}} is undecidable. (Hint: Use a reduction from PCP⁡\operatorname {PCP}. Given an instance

P={[t1b1],[t2b2],…,[tkbk]} P=\left\{ \left[\frac{t_{1}}{b_{1}}\right],\left[\frac{t_{2}}{b_{2}}\right], \ldots ,\left[\frac{t_{k}}{b_{k}}\right]\right\}

of the Post Correspondence Problem, construct a CFGG\mathrm{CFG} G with the rules

S→T∣BT→t1Ta1∣⋯∣tkTak∣t1a1∣⋯∣tkakB→b1Ba1∣⋯∣bkBak∣b1a1∣⋯∣bkak \begin{aligned} & S \rightarrow T \mid B \\ & T \rightarrow t_{1} T \mathbf{a}_{1} \mid \cdots \mid t_{k} T \mathbf{a}_{k} \mid t_{1} \mathbf{a}_{1} \mid \cdots \mid t_{k} \mathbf{a}_{k} \\ & B \rightarrow b_{1} B \mathbf{a}_{1} \mid \cdots \mid b_{k} B \mathbf{a}_{k} \mid b_{1} \mathbf{a}_{1} \mid \cdots \mid b_{k} \mathbf{a}_{k} \end{aligned}

where a1,…,ak\mathrm{a}_{1}, \ldots , \mathrm{a}_{k} are new terminal symbols. Prove that this reduction works.)

?
Problem 5.22

Show that AA is Turing-recognizable iff A≤mATM A \leq_{\mathrm{m}} A_{\text{TM }}.

?
Problem 5.23

Show that AA is decidable iff A≤m0∗1∗A \leq_{\mathrm{m}} 0^{*} 1^{*}.

?
Problem 5.24

Let J={w∣either w=0x for some x∈ATM , or w=1y for some y∈ATM ‾}J=\left\{ w \mid \text{either } w=0 x \text{ for some } x \in A_{\text{TM }}, \text{ or } w=1 y \text{ for some } y \in \overline{A_{\text{TM }}}\right\}. Show that neither JJ nor Jˉ\bar{J} is Turing-recognizable.

?
Problem 5.25

Give an example of an undecidable language BB, where B≤mBˉB \leq_{\mathrm{m}} \bar{B}.

?
Problem 5.26

Define a two-headed finite automaton (2DFA) to be a deterministic finite automaton that has two read-only, bidirectional heads that start at the left-hand end of the input tape and can be independently controlled to move in either direction. The tape of a 2DFA is finite and is just large enough to contain the input plus two additional blank tape cells, one on the left-hand end and one on the right-hand end, that serve as delimiters. A 2DFA accepts its input by entering a special accept state. For example, a 2DFA can recognize the language {an bncn∣n≥0}\left\{ \mathrm{a}^{n} \mathrm{~ b}^{n} \mathrm{c}^{n} \mid n \geq 0\right\}.

?
(a)

Let A2DFA ={⟨M,x⟩∣M is a 2DFA and M accepts x}A_{\text{2DFA }}=\left\{ \langle M, x\rangle \mid M\text{ is a 2DFA and }M\text{ accepts }x\right\}. Show that A2DFA A_{\text{2DFA }} is decidable.

(b)

Let E2DFA ={⟨M⟩∣M is a 2DFA and L(M)=∅}E_{\text{2DFA }}=\left\{ \langle M\rangle \mid M\text{ is a 2DFA and }L(M)=\emptyset \right\}. Show that E2DFA E_{\text{2DFA }} is not decidable.

Problem 5.27

A two-dimensional finite automaton (2DIM-DFA) is defined as follows. The input is an m×nm \times n rectangle, for any m,n≥2m, n \geq 2. The squares along the boundary of the rectangle contain the symbol and the internal squares contain symbols over the input alphabet Σ\Sigma. The transition function δ:Q×(Σ∪{#})⟶Q×{L,R,U,D}\delta : Q \times (\Sigma \cup \left\{ \# \right\} ) \longrightarrow Q \times \left\{ \mathrm{L}, \mathrm{R}, \mathrm{U}, \mathrm{D}\right\} indicates the next state and the new head position (Left, Right, Up, Down). The machine accepts when it enters one of the designated accept states. It rejects if it tries to move off the input rectangle or if it never halts. Two such machines are equivalent if they accept the same rectangles. Consider the problem of determining whether two of these machines are equivalent. Formulate this problem as a language and show that it is undecidable.

?
Problem 5.28
  • ᴬ Rice's theorem. Let PP be any nontrivial property of the language of a Turing machine. Prove that the problem of determining whether a given Turing machine's language has property PP is undecidable.

In more formal terms, let PP be a language consisting of Turing machine descriptions where PP fulfills two conditions. First, PP is nontrivial-it contains some, but not all, TM descriptions. Second, PP is a property of the TM's language-whenever L(M1)=L(M2)L\left(M_{1}\right)=L\left(M_{2}\right), we have ⟨M1⟩∈P\left\langle M_{1}\right\rangle \in P iff ⟨M2⟩∈P\left\langle M_{2}\right\rangle \in P. Here, M1M_{1} and M2M_{2} are any TMs. Prove that PP is an undecidable language.

?
Problem 5.29

Show that both conditions in Problem 5.28 are necessary for proving that PP is undecidable.

Problem 5.28 (Rice's theorem): Let PP be a language consisting of Turing machine descriptions where PP fulfills two conditions. First, PP is nontrivial-it contains some, but not all, TM descriptions. Second, PP is a property of the TM's language-whenever L(M1)=L(M2)L\left(M_{1}\right)=L\left(M_{2}\right), we have ⟨M1⟩∈P\left\langle M_{1}\right\rangle \in P iff ⟨M2⟩∈P\left\langle M_{2}\right\rangle \in P. Here, M1M_{1} and M2M_{2} are any TMs.

?
Problem 5.30

Use Rice's theorem, which appears in Problem 5.28, to prove the undecidability of each of the following languages.

?
(a)

ᴬ INFINITE⁡TM ={⟨M⟩∣M is a TM and L(M) is an infinite language }\operatorname {INFINITE}_{\text{TM }}=\left\{ \langle M\rangle \mid M\text{ is a TM and }L(M)\text{ is an infinite language }\right\}.

(b)

{⟨M⟩∣M is a TM and 1011∈L(M)}\left\{ \langle M\rangle \mid M\text{ is a TM and }1011 \in L(M)\right\}.

(c)

ALL⁡TM={⟨M⟩∣M is a TM and L(M)=Σ∗}\operatorname {ALL}_{\mathrm{TM}}=\left\{ \langle M\rangle \mid M \text{ is a TM and } L(M)=\Sigma^{*}\right\}.

Problem 5.31

Let

f(x)={3x+1 for odd xx/2 for even x f(x)= \begin{cases} 3 x+1 & \text{ for odd } x \\ x / 2 & \text{ for even } x \end{cases}

for any natural number xx. If you start with an integer xx and iterate ff, you obtain a sequence, x,f(x),f(f(x)),…x, f(x), f(f(x)), \ldots. Stop if you ever hit 1. For example, if x=17x=17, you get the sequence 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Extensive computer tests have shown that every starting point between 1 and a large positive integer gives a sequence that ends in 1. But the question of whether all positive starting points end up at 1 is unsolved; it is called the 3x+13 x+1 problem. Suppose that ATM A_{\text{TM }} were decidable by a TM HH. Use HH to describe a TM that is guaranteed to state the answer to the 3x+13 x+1 problem.

?
Problem 5.32

Prove that the following two languages are undecidable.

?
(a)

OVERLAP⁡CFG ={⟨G,H⟩∣G and H are CFGs where L(G)∩L(H)≠∅}\operatorname {OVERLAP}_{\text{CFG }}=\left\{ \langle G, H\rangle \mid G\text{ and }H\text{ are CFGs where }L(G) \cap L(H) \neq \emptyset \right\}. (Hint: Adapt the hint in Problem 5.21.)

(b)

PREFIX-FREE⁡CFG ={⟨G⟩∣G is a CFG where L(G) is prefix-free }\operatorname {PREFIX-FREE}_{\text{CFG }}=\left\{ \langle G\rangle \mid G\text{ is a CFG where }L(G)\text{ is prefix-free }\right\}.

Problem 5.33

Consider the problem of determining whether a PDA accepts some string of the form {ww∣w∈{0,1}∗}\left\{ w w \mid w \in \left\{ 0,1\right\}^{*}\right\}. Use the computation history method to show that this problem is undecidable.

?
Problem 5.34

Let X={⟨M,w⟩∣M is a single-tape TM that never modifies the portion of the tape that contains the input w}X=\left\{ \langle M, w\rangle \mid M\text{ is a single-tape TM that never modifies the portion of the tape that contains the input }w\right\}. Is XX decidable? Prove your answer.

?
Problem 5.35

Say that a variable AA in CFG GG is necessary if it appears in every derivation of some string w∈Gw \in G. Let NECESSARY⁡CFG={⟨G,A⟩∣A is a necessary variable in G}\operatorname {NECESSARY}_{\mathrm{CFG}}=\left\{ \langle G, A\rangle \mid A\text{ is a necessary variable in }G\right\}.

?
(a)

Show that NECESSARY⁡CFG \operatorname {NECESSARY}_{\text{CFG }} is Turing-recognizable.

(b)

Show that NECESSARY⁡CFG \operatorname {NECESSARY}_{\text{CFG }} is undecidable.

Problem 5.36
  • Say that a CFG is minimal if none of its rules can be removed without changing the language generated. Let MIN⁡CFG={⟨G⟩∣G is a minimal CFG }\operatorname {MIN}_{\mathrm{CFG}}=\left\{ \langle G\rangle \mid G\text{ is a minimal CFG }\right\}.
?
(a)

Show that MIN⁡CFG \operatorname {MIN}_{\text{CFG }} is T-recognizable.

(b)

Show that MIN⁡CFG\operatorname {MIN}_{\mathrm{CFG}} is undecidable.