Theory of Computation, Homework 4

advertisement
Theory of Computation, Homework 4
5.1
is decidable and there exists a decider
deciding it. That is,
Assume
constructing a TM
to decide
is possible as follows.
=”On input CFG
generating all possible strings
1. derive a CFG
2. run
to decide whether
3. accept if it accepts; reject, otherwise.”
However,
decidable.
and
are equivalent
is undecidable, which contradicts the assumption that
5.2
Since
is decidable,
can be used to test if a string
Turing-recognizer
for the complement of
following to show
is Turing-recognizable.
, where
is
is a CFL. A
can be constructed in the
=”On input CFGs
1. enumerate strings with lengths in an ascending order
2. for each string enumerated
a. run
to decide if
b. accept if either
c. continue otherwise”
and if
and
, or
and
5.3
5.9
Assume is decidable. Then there exists a decider for which can be used to decide
The following TM
is constructed to be an instance of .
”given
1. accept if
2. reject if
3. accept if
, on input
accepts
Obviously, when
decider for
,
. Otherwise, reject.
,
can be decided such that
is decidable. However,
decidable.
iff
accepts
. That is, by using the
can also be decided. Therefore,
is not decidable, contradicting the assumption
is
.
5.12
is a single-tape TM which writes a blank symbol over a nonblank
Let
symbol during the course of its computation on any input string be a language. Assume there
deciding . The goal is to reduce
to . Therefore, we construct a TM
is a decider
which decides
using
.
”on input
1. construct TM
by modifying
a. for each transition which writes a blank symbol, replace the blank symbol with a
new nonblank symbol not in
b. for each transition which reads a blank symbol, replace the blank symbol with the
new nonblank symbol that is previously written
c. for each transition to the accept state, write a nonblank symbol, overwrite with a
blank symbol and then go to the accept state
2. run
to decide
accepts; otherwise, reject”
3. accept if
Obviously,
can be decided by TM
undecidable. Hence,
is undecidable.
, leading to a contradiction because
is
5.14
is a TM which ever attempts to move its head left when its head is on
Let
the left-most tape cell on input
The goal is to reduce
to
.
be a language. Assume there is a decider
deciding .
. Therefore, we construct a TM
which decides
using
”on input
1. construct TM
by modifying
a. shift the input on the tape one cell right
b. write the cell at the left-hand end (using a mark to avoid moving left from the
leftmost cell) with a new symbol, say ‘@,’ not in
c. add a transition for the head to move one cell right on reading ‘@’
d. when the accept state is reached, move the head left off the leftmost cell
2. run
to decide
3. accept if
accepts; otherwise, reject”
Obviously,
can be decided by TM
undecidable. Hence, is undecidable.
, leading to a contradiction because
is
5.21
The goal is to reduce
to
. Given an instance of
as follows
,
a corresponding instance
If
of
can be constructed in the following.
has a match
with indices
, then a string
produced by
and
. That is,
can be derived from both
is an ambiguous CFG.
On the other hand, if
is ambiguous, all the generated strings of the form
is a string containing symbols in
derivations as follows.
where
must have at most two
One is S => T =>*.
The other is .S => B =>*
As a result,
which a match of
implies
.
can be decided, then the instance
Therefore, if the instance of
can also be decided. However, it’s impossible since
is undecidable.
of
5.22
(←) If
, then by the Theorem 5.28,
Turing-recognizable.
(→) If
is also Turing-recognizable because
is Turing-recognizable, there exists a TM
recognizing
. Now we define function
reduction of
to
.
. Obviously, for every input
,
is
. That is,
to be the
. Hence,
5.23
(←) If
, then there exists a computable function
. Since
be decided by running
(→) If
on
, where
is regular, there is a decider
, where
is decidable, there is a decider
for
is an input string in
that decides
5.30(b)
Rice’s theorem holds when
can
.
. Now we define function as
. Obviously,
since for every input
. Obviously,
,
is the reduction of
. Hence,
to
.
is a nontrivial property of the language of a Turing machine. In
this problem, is the property that
. Besides,
has to fulfill the following two
conditions.
1.
is nontrivial - it contains some, but not all, TM descriptions.
Let
2.
and
. Obviously,
contains
but not
is a property of the TM's language - whenever L(M1) = L(M2), we have
. Here,
and
are any TMs.
By definition, is a property of the language of TM
,
.
Since
satisfies the two conditions above,
Rice’s theorem, the language
is a nontrivial property of
. Hence, by
is undecidable.
.
iff
Download