You are on page 1of 1

Introduction to Algorithms Problem Set 9

CS 4820 Fall 2017 Due 11:59pm Thursday, November 16

Your homework submissions need to be typeset (hand-drawn figures are OK). Your solution to
each question needs to be uploaded to CMS as a separate pdf file. To help enable more anonymous
grading: do not write your name on the homework (CMS will know it’s your submission).
Collaboration is encouraged. Write the netid of your collaborators on your solution.
However, you need to write up solutions separately!

(1) (10 points) The questions below ask you to construct a Turing machine that takes an input
.xt, where x is a string of 0’s and 1’s, and outputs ”yes” or ”no”, and accept if x is of the form
of some number of 1’s followed by the same number of 0s. So your Turing machine should accept
x = 111000, but reject x = 110100 or x = 01. Your alphabet should at least contain the symbols
., 0, 1, t, but it may also contain other symbols if you find it convenient. You do not need to write
out the complete state transition diagram of your machine. You should either list all of its states
and explain (in plain English) what each one does, or describe the algorithm is the restricted type
of pseudocode described in Section 2.1 of the Turing machine lecture notes and in the November
8th lecture. Analyze your algorithm’s running time as a function of the input size |x|. As always
you can express the running time in O(.) notation, without working out precise constants. You do
not need to include a proof of correctness.

(2) (10 points) Prove that the following problems are decidable, that is, there is a Turing
machine that on all input eventually gets into the accept state ”yes” or reject state ”no”, and
correctly decides the question. You can use the existence of a universal Turing machine to argue
that a problem is solvable, and can also use a Turing machine with some extra tapes, and give an
explanation of a Turing machine that decides the question. You do not need to write out the whole
transition diagram of your machine. Note that your algorithm (Turing machine) doesn’t have to
run in polynomial time. Also you do not need to include a proof of correctness.

(a.) (5 points) Given a Turing machine M , and an input string .xt where x consist of n 1s (so
x = 111111 of length n), does M accept x in T = n steps? (Hint: You use a second tape to
count the number of steps.)
(b.) (5 points) Given a Turing machine M , and input x, does M accept input x, without writing
any symbols, or the head leaving the initial segment of the tape where input x is written.

(3) (10 points) Prove that the following problems are undecidable, that is, there is no Turing
machine that on all input eventually gets into the accept state ”yes” or reject state ”no”, and
correctly decides the question. For proving things undecidable, you may want to wait for lecture
Monday, November 13th. To prove that a problem is not computable, you are only allowed to use
facts we learned in this class (and not facts you may know from a different class).

(a.) (5 points) Given a Turing machine M , does M accept the empty input (that is, input .t)?
(b.) (5 points) Given a Turing machine M , does M accept at least one input x that has a 2 in
some position?

You might also like