
CUUS063 main CUUS063 Goldreich 978 0 521 88473 0 March 31, 2008 18:49
EXERCISES
stationary vertex distribution (which is well defined assuming the graph is not bipar tite,
which in turn may be enforced by adding a self-loop). On one hand,
E[X
u,v
+ X
v,u
] =
lim
n→∞
(n/E[Z
u,v
(n)]), due to the memoryless property of the walk. On the other hand,
letting χ
v,u
(i)
def
= 1 if the edge {u,v} was traversed from v to u in the i
th
step of such
a random walk and χ
v,u
(i)
def
= 0 otherwise, we have
n
i=1
χ
v,u
(i) ≤ Z
u,v
(n) + 1and
E[χ
v,u
(i)] = 1/2|E| (because, in each step, each directed edge appears on the walk
with equal probability). It follows that E[X
u,v
] < 2|E|.
Exercise 6.20 (the class PP ⊇ BP P and its relation to #P): In contrast to BPP,
which refers to useful probabilistic polynomial-time algorithms, the class PP does not
capture such algorithms but is rather closely related to #P. A decision problem S is in
PP if there exists a probabilistic polynomial-time algorithm A such that, for every x,
it holds that x ∈ S if and only if
Pr[A(x) = 1] > 1/2. Note that BPP ⊆ PP.Prove
that PP is Cook-reducible to #P and vice versa.
Guideline: For S ∈ PP (by virtue of the algorithm A), consider the relation R such
that (x, r) ∈ R if and only if A accepts the input x when using the random-input
r ∈{0, 1}
p(|x|)
,wherep is a suitable polynomial. Thus, x ∈ S if and only if |R(x)| >
2
p(|x|)−1
, which in turn can de determined by querying the counting function of R.
To reduce f ∈ #P to PP, consider the relation R ∈ PC that is counted by f (i.e.,
f (x ) =|R(x)|) and the decision problem S
f
as defined in Proposition 6.15.Let p be
the polynomial specifying the length of solutions for R (i.e., (x, y) ∈ R implies |y|=
p(|x|)), and consider the following algorithm A
: On input (x, N ), with probability 1/2,
algorithm A
uniformly selects y ∈{0, 1}
p(|x|)
and accepts if and only if ( x , y) ∈ R,and
otherwise (i.e., with the remaining probability of 1/2) algorithm A
accepts with proba-
bility exactly
2
p(|x|)
−N +0.5
2
p(|x|)
.Provethat(x, N ) ∈ S
f
if and only if Pr[A
(x ) = 1] > 1/2.
Exercise 6.21 (enumeration problems): For any binary relation R, define the enumer-
ation problem of
R as a function f
R
: {0, 1}
∗
× N →{0, 1}
∗
∪{⊥}such that f
R
(x, i)
equals the i
th
element in |R(x)| if |R(x)|≥i and f
R
(x, i) =⊥otherwise. The above
definition refers to the standard lexicographic order on strings, but any other efficient
order of strings will do.
25
1. Prove that, for any polynomially bounded R, computing #R is reducible to computing
f
R
.
2. Prove that, for any R ∈ PC, computing f
R
is reducible to some problem in #P.
Guideline: Consider the binary relation R
={(x, b, y):(x, y) ∈R ∧ y ≤ b},andshow
that f
R
is reducible to #R
.
(Extra hint: Note that f
R
(x , i) = y if and only if |R
(x , y)|=i and for every y
< y it holds that
|R
(x , y
)| < i.)
Exercise 6.22 (artificial #P-complete problems): Show that there exists a relation
R ∈ PC such that #R is #P-complete and S
R
={0, 1}
∗
. Furthermore, prove that
for ever y R
∈ PC there exists R ∈ PF ∩ PC such that for every x it holds that
#R(x) = #R
(x) + 1. Note that Theorem 6.19 follows by starting with any relation
R
∈ PC such that #R
is #P-complete.
25
An order of strings is a 1-1 and onto mapping µ from the natural numbers to the set of all strings. Such order is
called efficient if both µ and its inverse are efficiently computable. The standard lexicographic order satisfies µ(i) = y
if the string 1y is the (compact) binary expansion of the integer i;thatisµ(1) = λ, µ(2) = 0, µ(3) = 1, µ(4) = 00,
etc.
235