Docsity

CS 172, Midterm 2 Solutions, Spring 1999: Problem Solutions for Computer Science Students, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS 172, Spring 1999
Midterm #2 Solutions
Professor Manuel Blum
Problem #1
a) 1011*1101 = 10001111 b) yes yes yes no no The n-bit numbers are all x
in Z^+ 2^(n-1) <= x < 2^n The product of an m-bit number x and an n-bit
number y is therefore x*y with 2^(m+n-2) <= x*y < 2^(m+n). So๎š… The product
of an m-bit by n-bit number, for m, n >= 1, is either m+n or m+n-1 bits.
Problem #2
YES: (1+x)^2 + y^4(1+z^6) ๎š– 3 = 0 x = 0 y = 1 z = 1
Problem #3
Don't know! However, if that's your complete answer, you won't get much
credit. Let's see what's going on: Part 1: Note: to be in NP, the length
of the proof (NP ๎š– proof) must be upper bounded by a fixed polynomial of
the input length (length of f). [i.e. the time to compute f(x_1, ๎š… x_k)
for given values of x_1, ๎š… , x_k in {0, 1} must be <= poly(length of
f(x_1, ๎š… , x_k)) for some fixed polynomial.] Part 2: If the definition of
multivariate polynomial did not permit any exponentiation at all (so that
x^3 would have to be written x*x*x), then the answer would be YES. That's
because + and * cannot increase the length of an expression: an m-bit +
n-bit number has length <= 1 + MAX{m, n} An m-bit * n-bit number has
length <= m+n Part 3: If the definition of multivariate poly did permit
raising to a unary power, but did not permit nesting powers (such as
((2^11)^11)^11 = ((2^2)^2)^2 = 2^(2*2*2) = 2^(2^3)), then the answer
would be YES. That's because the length of an (m-bit binary
number)^((n-m)-bit unary power) is (m + ๎š… + m )= m(n-m), which is
maximized at m = n/2. Therefore max = n^2/4. In this case, the fixed
polynomial would be O(n^2). Part 4: But we are allowing nested powers. So
we can get big numbers; eg. ((2^11)^11 ๎š…)^11 = 2^(2*2 ๎š… 2) = 2^(2^k), which
has length 2^k. This does not imply that ZMP is NOT in NP, since it might
be possible to get the final answer to the decision problem (YES or NO)
without generating such large numbers. For example, might succeed by
doing all computations modulo small primes. =GOOD PHD PROBLEM!=
Problem #4
Don't know: Same reasoning as problem 3, though the final answer, when
known, might be different.
CS 172, Midterm #2 Solutions, Spring 1999
CS 172, Spring 1999 Midterm #2 Solutions Professor Manuel Blum 1
pf2

Partial preview of the text

Download CS 172, Midterm 2 Solutions, Spring 1999: Problem Solutions for Computer Science Students and more Exams Advanced Algorithms in PDF only on Docsity!

CS 172, Spring 1999

Midterm #2 Solutions

Professor Manuel Blum

Problem

a) 10111101 = 10001111 b) yes yes yes no no The n-bit numbers are all x in Z^+ 2^(n-1) <= x < 2^n The product of an m-bit number x and an n-bit number y is therefore xy with 2^(m+n-2) <= x*y < 2^(m+n). So The product of an m-bit by n-bit number, for m, n >= 1, is either m+n or m+n-1 bits.

Problem

YES: (1+x)^2 + y^4(1+z^6) ย– 3 = 0 x = 0 y = 1 z = 1

Problem

Don't know! However, if that's your complete answer, you won't get much credit. Let's see what's going on: Part 1: Note: to be in NP, the length of the proof (NP ย– proof) must be upper bounded by a fixed polynomial of the input length (length of f). [i.e. the time to compute f(x_1, x_k) for given values of x_1, , x_k in {0, 1} must be <= poly(length of f(x_1, , x_k)) for some fixed polynomial.] Part 2: If the definition of multivariate polynomial did not permit any exponentiation at all (so that x^3 would have to be written xxx), then the answer would be YES. That's because + and * cannot increase the length of an expression: an m-bit + n-bit number has length <= 1 + MAX{m, n} An m-bit * n-bit number has length <= m+n Part 3: If the definition of multivariate poly did permit raising to a unary power, but did not permit nesting powers (such as ((2^11)^11)^11 = ((2^2)^2)^2 = 2^(222) = 2^(2^3)), then the answer would be YES. That's because the length of an (m-bit binary number)^((n-m)-bit unary power) ร  is (m +

  • m )= m(n-m), which is maximized at m = n/2. Therefore max = n^2/4. In this case, the fixed polynomial would be O(n^2). Part 4: But we are allowing nested powers. So we can get big numbers; eg. ((2^11)^11 )^11 = 2^(2*2
  1. = 2^(2^k), which has length 2^k. This does not imply that ZMP is NOT in NP, since it might be possible to get the final answer to the decision problem (YES or NO) without generating such large numbers. For example, might succeed by doing all computations modulo small primes. =GOOD PHD PROBLEM!=

Problem

Don't know: Same reasoning as problem 3, though the final answer, when known, might be different.

CS 172, Midterm #2 Solutions, Spring 1999

CS 172, Spring 1999 Midterm #2 Solutions Professor Manuel Blum 1

Problem

YES. Transform by mapping. 3SAT ร  ZMP T ร  0 F ร  1 + (OR) ร  * * (AND) ร  + X ร  x^ Conj(X) ร  (1-x)^2 Ex: (A + B + conj(C))(B + C)(conj(B)) ร  a^2 b^2 (1-c)^2 + b^2 c^2 + (1-b)^2 The map is poly-time

Problem

YES. Follows from part 5. Transform ZMP with degrees in unary ร  ZMP with degrees in ginary Ex: x^(1111111111111) ร  x^1101 In general, the map takes a multivariate poly expression into a shorter (or at least not longer) expression. It's poly-time. It maps YES ร  YES NO ร  NO

Posted by HKN (Electrical Engineering and Computer Science Honor Society)

University of California at Berkeley

If you have any questions about these online exams

please contact [email protected].

CS 172, Midterm #2 Solutions, Spring 1999

Problem #5 2