Computational Complexity Theory, Fall 2008
October 10
Lecture 12: BPP in PH, BLP, Random walks and USTCON
Lecturer: Kristoffer Arnsfelt Hansen
Scribe: Mark Greve
Continuing our studies of randomized computation, we show in the first part of this lecture
that BPP is in PH. Next up are analogs of probabilistic complexity classes with logarithmic space
bounds. We study properties of random walks, and show how these can be used to solve problems
using randomization with little space.
BPP in PH
Theorem 1 BPP ⊆ Σp2 ∩ Πp2
Proof We will prove that BPP ⊆ Σp2 . Once we have proved this, we use the fact that BPP =
coBPP ⊆ coΣp2 = Πp2 to complete the remaining part of the theorem. Let L ∈ BPP. Then by
amplification there is a polynomial time algorithm for L using m random bits, which has error less
1
than 2m
.
1
Take an x ∈ Σn , then x ∈ L ⇔ Pry∈{0,1}m (hx, yi ∈ R) ≥ 1− 2m
, and x 6∈ L ⇔ Pry∈{0,1}m (hx, yi ∈ R) ≤
1
2m for some R ∈ P .
1
For a given x, let Sx = {y ∈ {0, 1}m | hx, yi ∈ R}. Then x ∈ L ⇒ |Sx | ≥ (1 − 2m
)2m , and
1 m
x 6∈ L ⇒ |Sx | ≤ 2m 2 .
We claim that
x∈L
m
∃u1 , u2 , . . . , um ∈ {0, 1}m ∀r ∈ {0, 1}m ∃i. hx, r ⊕ ui i ∈ R
m
∃u1 , u2 , . . . , um ∈ {0, 1}m .
m
[
{r ∈ {0, 1}m | r ⊕ ui ∈ Sx } = {0, 1}m
i=1
m
∃u1 , u2 , . . . , um .
m
[
ui ⊕ Sx = {0, 1}m ,
i=1
which we prove now. Notice that this is a Σp2 statement.
1 m
Assume x 6∈ L. Using |Sx | ≤ 2m
2 , we get that
|
∪m
i=1
ui ⊕ Sx | ≤
m
X
|ui ⊕ Sx | =
i=1
m
X
i=1
|Sx | = m
1 m
2 < 2m ,
2m
m
i.e. there is no choice of u1 , u2 , . . . , um such that ∪m
i=1 ui ⊕ Sx = {0, 1} .
1
For the other direction, assume that x ∈ L.
Then Sx ≥ 1 − 2m 2m . We have to show the
S
m
existence of u1 , u2 , . . . , um ∈ {0, 1}m such that i=1 ui ⊕ Sx = {0, 1}m . So pick u1 , . . . um ∈ {0, 1}m
uniformly at random and independently. Let r ∈ {0, 1}m be fixed, then
1
Pr(r 6∈
∪m
i=1 ui ⊕Sx )
= Pr(∀i : r 6∈ ui ⊕Sx ) = Pr(∀i : ui 6∈ r⊕Sx ) =
m
Y
Pr(ui 6∈ r⊕Sx ) ≤
i=1
1
2m
m
<
1
2m
m
m 1
We get that Pr (∃r ∈ {0, 1}m : r 6∈ ∪m
i=1 ui ⊕ Sx ) ≤ Σr∈{0,1}m Pr (r 6∈ ∪i=1 ui ⊕ Sx ) < 2 2m = 1,
i.e there exists some choice for u1 , . . . , um that works for all r.
Space-bounded probabilistic computation
We define BPL to be the class of languages computed by probabilistic Turing machines in space
O(log n) and that always halt in time nO(1) with error probability < 31 . We define RL to be the
class of languages computed by a probabilistic Turing Machine in space O(log n) that always halts
in time nO(1) with one-sided positive error < 13 . Note that L ⊆ RL ⊆ NL.
We will now have a look at the U ST CON problem, and show that it is in RL. U ST CON is
the following problem: Given an undirected graph G = (V, E) and vertices s, t ∈ V , does there
exist a path from s to t in G?
We claim that the following algorithm can be used to show that U ST CON is in RL: Take a
random walk starting at s for nO(1) steps. Accept if you get to t during the walk. To prove that
the algorithm works, we need to study some basic properties of random walks.
Random walks
A random walk is performed as follows: at any node, pick a neighbor according to some distribution
and continue the random walk from there. First we look at properties of random walks in regular
undirected multigraphs. A undirected graph is said to be d-regular if the degree of every node is
d, and said to be regular if it is d-regular for some d.
Let G be a d-regular multigraph, and define the normalized adjacency matrix for G to be
A = A(G) by Aij = number of edgesd between i and j . If we take a distribution on the vertices p ∈ Rn (i.e.
P
n
i=1 pi = 1 and 0 ≤ pi ≤ 1 for all i), then Ap is exactly the distribution obtained by picking a
vertex according to p and following an edge of G at random. More generally, Al p is a distribution
for a walk of length l. It turns out that linear algebra is very useful to understanding random
walks, so next we will revisit some basic linear algebra.
Basic linear algebra
Let ~u, ~v ∈ Rn . Define the inner product of ~u and ~v as h~u, ~v i =
We recall two different norms from linear algebra:
L2 -norm:
v
u n
uX
k~v k2 = t
vi2 .
i=1
L1 -norm:
k~v k1 =
n
X
i=1
2
|vi |.
Pn
i=1 ui vi .
We also recall the Cauchy-Schwarz inequality, which we state without proof.
|h~u, ~v i| ≤ k~uk2 k~v k2
Using the Cauchy-Schwarz inequality, we derive the following relationships relating the two
norms,
k~v k1 ≤
√
nk~v k2
k~v k2 ≤ k~v k1
Pn
Pn
Pn
√
2
2 =
1
·
|v
|
≤
|v
|
=
which can
be
proved
as
follows
k~
v
k
=
nk~
v
k
,
and
k~
v
k
i
i
1
2
2
i=1
i=1
i=1 vi ≤
Pn
max |vi | i=1 |vi | ≤ k~v k1 k~v k1 = k~v k21 .
Spectral theorem for real symmetric matrices
We recall the spectral theorem for symmetric real matrices. Let A be a symmetric n×n real matrix,
then there is a diagonal matrix D and an orthogonal matrix U such that A = U DU T , where ui is
an eigenvector with associated eigenvalue λi , i.e. Aui = λi ui , and u1 , u2 , . . . , un is a basis of Rn .
Properties of random walks
We now return to basic properties of random walks. We start by studying properties of random
walks when we use an uniform distribution on the vertices. So take a uniform distribution u =
( n1 , n1 , . . . , n1 ) on the vertices.
Theorem 2 Let G be d-regular for some d ∈ N, and u be the uniform distribution on the vertices,
then Au = u.
Let us order the eigenvalues of A by absolute value, |λ1 | ≥ |λ2 | ≥ . . . ≥ |λn |. Then we define
the parameter λ(G) of G to be λ(G) = λ(A) = maxkvk2 =1,v⊥u kA~v k. It is a fact that λ(G) = |λ2 |.
We are interested in how fast a random walk will converge to the uniform distribution. The key
parameter here is the spectral grap of G, which is defined to be 1 − λ(G). The larger the spectral
gap is, the faster the random walk will converge to a uniform distribution.
Lemma 3 Let G be a n-vertex regular graph and let p be a distribution, then kAl p − uk2 ≤ λl
Lemma 4 Let G be a d-regular connected graph with self-loops at every vertex, then λ(G) ≤ 1 −
1
.
4dn2
Corollary 5 Let G be a d-regular graph with self-loops. Let s be a vertex in G, let l = 8dn2 ln(n),
1
and let q = Al es , then for every t connected to s, we have Pr(q = t) ≥ 2n
.
1
Proof Consider the connected component G0 of s. By Lemma 4, we have that λG0 ≤ 1 − 4dn
2,
2 ln(n)
2
2
8dn ln(n)
4dn
1
1
and by using Lemma 3 we have that kAl p − uk2 ≤ 1 − 4dn
= 1 − 4dn
≤
2
2
1 2 ln(n)
e
= n12 , where we used that 1 + x ≤ ex for all x ∈ R. So we have that |(Al p − u)i | ≤
1
.
every i, since the norm ≤ n12 . This implies that | Al p i | ≥ n1 − n12 ≥ 2n
3
1
n2
for
By the above lemmas and corollaries the algorithm presented for USTCON is in RL if we take
a random walk for say O(n4 ) steps. Technically we need to make the graph d-regular for some
d, and we can easily do this by adding a lot of self-loops to the graphs. Though clearly for the
purposes of finding a path from s to t self-loops would be useless to add.
4
© Copyright 2026 Paperzz