• Home
  • Textbooks
  • Languages and Machines: An Introduction to the Theory of Computer Science
  • Decidability

Languages and Machines: An Introduction to the Theory of Computer Science

Thomas A. Sudkamp

Chapter 11

Decidability - all with Video Answers

Educators


Chapter Questions

Problem 1

Describe a Turing machine that solves the specified decision problem. Use Example 11.1.2 as a model for defining the actions of a computation of the machine. You need not explicitly construct the transition function.
Design a two-tape Turing machine that determines whether two strings $u$ and $v$ over $\{0, I\}$ are identical. The computation begins with $B u B v B$ on the tape and should require no more than $2($ length $(u)+1)$ transitions.

Check back soon!

Problem 2

Describe a Turing machine that solves the specified decision problem. Use Example 11.1.2 as a model for defining the actions of a computation of the machine. You need not explicitly construct the transition function.
Design a Turing machine whose computations decide whether a natural number is prime. Represent the natural number $n$ by a sequence of $n+1 l$ 's.

Check back soon!

Problem 3

Describe a Turing machine that solves the specified decision problem. Use Example 11.1.2 as a model for defining the actions of a computation of the machine. You need not explicitly construct the transition function.
Let $\mathrm{G}=(\mathrm{V}, \Sigma, \mathrm{P}, S)$ be a regular grammar.
a) Construct a representation for the grammar $\mathrm{G}$ over $\{0, I\}$.
b) Design a Turing machine that decides whether a string $w$ is in $\mathrm{L}(\mathrm{G})$. The use of nondeterminism facilitates the construction of the desired machine.

Check back soon!

Problem 4

Describe a Turing machine that solves the specified decision problem. Use Example 11.1.2 as a model for defining the actions of a computation of the machine. You need not explicitly construct the transition function.
A tour in a directed graph is a path $p_0, p_1, \ldots, p_n$ in which
i) $p_0=p_n$.
ii) For $0<i, j \leq n, i \neq j$ implies $p_i \neq p_j$.
iii) Every node in the graph occurs in the path.
Design a Turing machine that decides whether a directed graph contains a tour. Use the representation of a directed graph given in Example 11.1.2.

Check back soon!
02:41

Problem 5

Describe a Turing machine that solves the specified decision problem. Use Example 11.1.2 as a model for defining the actions of a computation of the machine. You need not explicitly construct the transition function.
Design a Turing machine that solves the " $2^n$ " problem. The representation of a natural number $i$ is $I^{i+1}$. The input is the representation of a natural number $i$ and the output is yes if $i=2^n$ for some $n$, no otherwise.

Chris Trentman
Chris Trentman
Numerade Educator

Problem 6

Let M be the Turing machine
(FIGURE CANT COPY).
a) What is L(M)?
b) Give the representation of M using the encoding from Section 11.3.

Check back soon!
07:01

Problem 7

Construct a Turing machine that decides whether a string over $\{0, I\}^*$ is the encoding of a nondeterministic Turing machine. What would be required to change this to a machine that decides whether the input is the representation of a deterministic Turing machine?

Chris Trentman
Chris Trentman
Numerade Educator

Problem 8

Design a Turing machine with input alphabet $\{0, l\}$ that accepts an input string $u$ if
i) $u=R(\mathrm{M}) w$ for some Turing machine $\mathrm{M}$ and input string $w$, and
ii) when $\mathrm{M}$ is run with input $w$, there is a transition in the computation that prints a 1 .

Check back soon!

Problem 9

Given an arbitrary Turing machine $\mathrm{M}$ and input string $w$, will the computation of $\mathrm{M}$ with input $w$ halt in fewer than 100 transitions? Describe a Turing machine that solves this decision problem.

Check back soon!

Problem 10

The halting problem and the universal machine introduced in Sections 11.3 and 11.4 were concerned only with the halting of Turing machines. Consequently, the representation scheme $R(\mathrm{M})$ did not encode accepting states.
a) Extend the representation $R(\mathrm{M})$ of a Turing machine $\mathrm{M}$ to explicitly encode the accepting states of $\mathrm{M}$.
b) Design a universal machine $\mathrm{U}_f$ that accepts input of the form $R(\mathrm{M}) w$ if the machine $\mathrm{M}$ accepts input $w$ by final state.

Check back soon!

Problem 11

Let $\mathrm{M}$ be a deterministic Turing machine that accepts a nonrecursive language. Prove that the halting problem for $\mathrm{M}$ is undecidable. That is, there is no machine that takes input $w$ and determines whether the computation of M halts with input $w$.

Check back soon!

Problem 12

Use reduction to establish the undecidability of the each of the decision problems.
Prove that there is no algorithm that determines whether an arbitrary Turing machine halts when run with the input string $10 I$.

Check back soon!

Problem 13

Use reduction to establish the undecidability of the each of the decision problems.
Prove that there is no algorithm that determines whether an arbitrary Turing machine halts for any input. That is, $R(\mathrm{M})$ is accepted if $\mathrm{M}$ halts for some string $w$. Otherwise, $R(\mathrm{M})$ is rejected.

Check back soon!
09:01

Problem 14

Use reduction to establish the undecidability of the each of the decision problems.
Prove that there is no algorithm with input consisting of a Turing machine $M=$ $\left(\mathrm{Q}, \Sigma, \Gamma, \delta, q_0, \mathrm{~F}\right)$, a state $q_i \in \mathrm{Q}$, and a string $w \in \Sigma^*$ that determines whether the computation of $\mathrm{M}$ with input $w$ enters state $q_i$.

Chris Trentman
Chris Trentman
Numerade Educator

Problem 15

Use reduction to establish the undecidability of the each of the decision problems.
The computation of a Turing machine $\mathrm{M}=\left(\mathrm{Q}, \Sigma, \Gamma, \delta, q_0, \mathrm{~F}\right)$ with input $w$ reenters the start state if the machine is in state $q_0$ at any time other than the initiation of the computation. Prove that there is no algorithm that determines whether a Turing machine reenters its start state.

Check back soon!

Problem 16

Use reduction to establish the undecidability of the each of the decision problems.
Prove that there is no algorithm with input consisting of a Turing machine $\mathbf{M}=$ $\left(\mathrm{Q}, \Sigma, \Gamma, \delta, q_0, \mathrm{~F}\right)$, a tape symbol $x$, and a string $w \in \Sigma^*$ that determines whether the computation of $\mathrm{M}$ with input $w$ prints the symbol $x$.

Check back soon!

Problem 17

Why can't we successfully argue that the blank tape problem is undecidable as follows: The blank tape problem is a subproblem of the halting problem which is undecidable and therefore must be undecidable itself.

Check back soon!

Problem 18

Use Rice's theorem to show that the following properties of recursively enumerable languages are undecidable. To establish the undecidability, all you need do is show that the property is nontrivial.
a) L contains a particular string $w$.
b) $\mathrm{L}$ is finite.
c) $\mathrm{L}$ is regular.
d) $\mathrm{L}$ is $\{0,1\}^*$.

Check back soon!

Problem 19

Let $L=\{R(M) \mid M$ halts when run with $R(M)\}$.
a) Show that $\mathrm{L}$ is not recursive.
b) Show that $\mathrm{L}$ is recursively enumerable.

Check back soon!

Problem 20

Show that the language $L_\lambda$ is recursively enumerable.

Check back soon!
02:34

Problem 21

Show that the language $L_{\not \emptyset \emptyset}=\{R(M) \mid L(M)$ is nonempty $\}$ is recursively enumerable.

Chris Trentman
Chris Trentman
Numerade Educator
00:53

Problem 22

Give an example of a property of languages that is not satisfied by any recursively enumerable language.

Christopher Stanley
Christopher Stanley
Numerade Educator

Problem 23

Show that the property $\mathfrak{P}$, "L is context-free," is a nontrivial property of recursively enumerable languages.

Check back soon!

Problem 24

Let $\mathrm{M}$ be the Turing machine
(FIGURE CANT COPY).
a) Give the rules of the semi-Thue system $S_M$ that simulate the computations of $M$.
b) Trace the computation of $\mathrm{M}$ with input 01 and give the corresponding derivation in $\mathrm{S}_{\mathrm{M}}$.

Check back soon!
01:17

Problem 25

Find a solution for each of the following Post correspondence systems.
a) $[a, a a],[b b, b],[a, b b]$
b) $[a, a a a],[a a b, b],[a b a a, a b]$
c) $[a a, a a b],[b b, b a],[a b b, b]$
d) $[a, a b],[b a, a b a],[b, a b a],[b b a, b]$

James Kiss
James Kiss
Numerade Educator
01:17

Problem 26

Show that the following Post correspondence systems have no solutions.
a) $[b, b a],[a a, b],[b a b, a a],[a b, b a]$
b) $[a b, a],[b a, b a b],[b, a a],[b a, a b]$
c) $[a b, a b a],[b a a, a a],[a b a, b a a]$
d) $[a b, b b],[a a, b a],[a b, a b b],[b b, b a b]$
e) $[a b b, a b],[a b a, b a],[a a b, a b a b]$

James Kiss
James Kiss
Numerade Educator

Problem 27

Prove that the Post correspondence problem for systems with a one-symbol alphabet is decidable.

Check back soon!
06:46

Problem 28

Build the context-free grammars $G_U$ and $G_V$ that are constructed from the Post correspondence system $[b, b b]$, [aa, baa $],[a b, a]$. Is $\mathrm{L}\left(\mathrm{G}_{\mathrm{U}}\right) \cap \mathrm{L}\left(\mathrm{G}_{\mathrm{V}}\right)=\emptyset$ ?

Chris Trentman
Chris Trentman
Numerade Educator
06:46

Problem 29

Let $\mathrm{C}$ be a Post correspondence system. Construct a context-free grammar that generates $\overline{\mathrm{L}\left(\mathrm{G}_{\mathrm{U}}\right)}$.

Chris Trentman
Chris Trentman
Numerade Educator

Problem 30

Prove that there is no algorithm that determines whether the intersection of the languages of two context-free grammars contains infinitely many elements.

Check back soon!

Problem 31

Prove that there is no algorithm that determines whether the complement of the language of a context-free grammar contains infinitely many elements.

Check back soon!