You are on page 1of 3

COMP 531: Advanced Theory of Computation

(Winter 2015)
Assignment 1
Due February 4th
Instructions
Follow these instructions closely.
You will benefit most if you seriously try solving each problem yourself. You may
work with each other but you must write up your own solutions. For each question, you
should clearly acknowledge the people you have worked with.
Clarity and conciseness of your solutions are as important as correctness.
It is important to learn how to write your ideas and solutions clearly and rigorously.
You will lose marks for correct solutions that are poorly explained/presented. When
writing your solutions, assume that your audience is your classmates rather than the
instructor of the course. The high level ideas and an overview of your argument should
be presented before any technical details, and all nontrivial claims have to be proven.
If you do not know how to solve a problem, do not answer it. This will earn you 20%
of the points. Do not make yourself believe in a wrong proof this is bad for you. And
definitely do not try to sell it! If you dont know how to solve a problem but you
have some nontrivial ideas, write them down. If you have a solution with gaps, write
your argument and clearly indicate the gaps.
Submit your assignments in class or send a copy to cbades@cs.mcgill.ca before
midnight of the due date.

Questions
1. (10 points) Let k be a counter initially set to 0. Increment k to 1, 2, . . . , n 1.
How many bit changes occur in total?
2. (10 points) Suppose that f and g are computable in logarithmic space. Show
that f g is computable in logarithmic space.
3. (10 points) Give an example of a nonregular language which can be decided in
O(log log n) space.
4. (10 points) Consider the following two Chinese algorithm to detect if a given
undirected graph has a cycle or not.
Imagine that two Chinese father and son are travelling along the edges of
G. Father sits at a vertex v (for v = 1, 2, . . . , |V |), while the son walks by the
so-called cycle searching principle:
for every vertex u of G, give all edges out from u an order according to their
end vertex; thus we can say the first edge out of u, the second edge out
of u and so on. Edge (u, v) may be the ith edge of u and the jth edge of v
with i 6= j
whenever entering a vertex u of fanout k along the ith edge of u, one must
go out along edge i + 1 (where k + 1 is taken to be 1)
Father remembers the edge along which the son departed and sees if he comes
back along the same edge. If, for every edge adjacent to v, the son does so, then
the father will take his son to vertex v + 1 (if v < |V |) or claim that G has no
cycle (if v = |V |). Otherwise there must be a cycle.
Prove that the algorithm is correct. (Show that G has no cycle iff, for every vertex,
the son always returns by the same edge along which he departed. Also show that
starting from every vertex v, the son will surely come back to v before he passes
2|E| edges.) What is the space complexity of this algorithm?
5. Prove the following statements:
(a) (5 points) If P = NP, then P = PH.
(b) (5 points) If PH = PSPACE, then PH = pk for some k.
6. (10 points) Let L = {x#xrev | x {0, 1} }. Suppose that L is decided by a
multitape Turing machine in time T (n) and space S(n). Show that T (n) S(n) =
(n2 ).
(Hint: This problem can be solved using a result from communication complexity:

Communication complexity concerns the following scenario. There are


two players with unlimited computational power, each of whom holds an
n bit input, say x and y. Neither knows the others input, and they wish
to collaboratively compute f (x, y) where function f : {0, 1}n {0, 1}n
{0, 1} is known to both. Furthermore, they had foreseen this situation,
so they had already before they knew their inputs x, y agreed upon
a protocol for communication. The cost of this protocol is the number
of bits communicated by the players for the worst-case choice of x, y.
Let M be a Turing machine that decides the language L in time T (n) and space
S(n). We want to use M to solve the following problem in communication
complexity. Suppose the function f that the two players, Alice and Bob, want to
collaboratively compute is

1,

f (x, y) =

y = xrev ,
0, otherwise.

It can be shown that the cost of any commmunication protocol used to compute
f (x, y) is at least n.
In our case, each player is assumed to have access to the Turing machine M which
he or she can simulate on arbitrary inputs. Construct a communication protocol in
which Alice and Bob take turns simulating M to compute f using O(T (n)S(n)/n)
bits of communication. Using the lower bound stated previously, conclude that
T (n)S(n) = (n2 ).)
7. (Extra Credit: 5 points) Color the edges of the complete undirected graph
on n vertices (i.e. Kn ) with c colors. Show that if n > rc then there must be a
monochromatic path of length r. Your proof must be self-contained.

You might also like