This preview shows pages 1–2. Sign up to view the full content.
CS 341 Automata Theory
Elaine Rich
Homework 11
Due Thursday, Nov. 16 at 11:00
1)
Define a Turing Machine
M
(using our macro language) that decides
L
, where
L
= {
x
y
=
z
:
x
,
y
,
z
∈
1
+
and, when
x
,
y
, and
z
are viewed as unary numbers,
x
y
=
z
}.
You may define subroutines if you like.
You may use, without
defining, the simple subroutines, such as R
❑
, that we defined in class.
2)
Define a Turing Machine
M
that computes the function
f
: {
a
,
b
}*
→
N
, where
f
(
x
) = the unary encoding of
max
(#
a
(
x
), #
b
(
x
)).
It’s okay to describe
M
in English, but your description must be precise.
3)
Define a Turing machine to decide
L
= {
ww
:
w
∈
{
a
,
b
}*}.
You do not need to write out the machine in our macro
language.
A clear English description is fine.
You may use nondeterminism and/or multiple tapes.
4)
In this question, we explore the equivalence between function computation and language recognition as performed by
Turing machines.
For simplicity, we will consider only functions from the nonnegative integers to the nonnegative
integers (both encoded in binary).
But the ideas of these questions apply to any computable function.
We’ll start with
the following definition:
•
Define the
graph
of a function
f
to be the set of all strings of the form [
x
,
f
(
x
)], where
x
is the binary encoding
of a nonnegative integer, and
f
(
x
) is the binary encoding of the result of applying
f
to
x
.
For example, the graph of the function
succ
is the set {[
0
,
1
], [
1
,
10
], [
10
,
11
], …}.
a)
Describe in clear English an algorithm that, given a Turing machine
M
that computes
f
, constructs a Turing
machine
M
′
that decides the language
L
that contains exactly the graph of
f
.
b)
Describe in clear English an algorithm that, given a Turing machine
M
that decides the language
L
that contains
the graph of some function
f
, constructs a Turing machine
M
that computes
f
.
c)
A function is said to be partial if it may be undefined for some arguments.
If we extend the ideas of this exercise
to partial functions, then we do not require that the Turing machine that computes
f
halts if it is given some input
x
for which
f
(
x
) is undefined.
Then
L
(the graph language for
f
), will contain entries of the form [
x
,
f
(
x
)] for only
those values of
x
for which
f
is defined.
In that case, it may not be possible to decide
L
, but it will be possible to
semidecide it.
Do your constructions for parts (a) and (b) work if the function
f
is partial?
If not, explain how you
could modify them so they will work correctly. By “work”, we mean:
•
For part (a): given a Turing machine that computes
f
(
x
) for all values on which
f
is defined, build a Turing
machine that semidecides the language
L
that contains exactly the graph of
f
;
•
For part (b): given a Turing machine that semidecides the graph language of
f
(and thus accepts all strings of
the form[
x
,
f
(
x
)] when
f
(
x
) is defined), build a Turing machine that computes
f
.
5)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '08
 Rich

Click to edit the document details