FL10 PDF
FL10 PDF
P0,0 P0,1 ··· P0,j ···
P1,0
P1,1 ··· P1,j ···
.. .. .. .. ..
.
P= . . . . .
Pi,0
Pi,1 ··· Pi,j ···
.. .. .. .. ..
. . . . .
Probability distribution for a given time t:
X
pi (t) = pj (t − 1)Pj,i
j≥0
Let P(n) be the matrix whose entries are the n-step transition
n
probabilities, so that the entry in the ith row and jth column is Pi,j
Then we have
P(n) = P · P(n−1) ,
and by induction on n
P(n) = Pn .
p̄(t + n) = p̄(t)Pn .
Example
Pr (Xi = 1 | Xi−1 = 0) = 1
For 1 ≤ t ≤ n − 1,
1
1 + (2nt + 2n − t 2 − t − t − 1 + 2nt − 2n − t 2 + t + t − 1) =
2
Dn = 1 + Dn−1 = 1 + (n − 1)(2n − n + 1) = n2 .
Theorem
Assuming that the formula has a satisfying assignment the
expected run-time to find that assignment is O(n2 ).
Theorem
There is a one-sides error randomized algorithm for the 2-SAT
problem that terminates in O(n2 log n) time, with high probability
returns an assignment when the formula is satisfiable, and always
returns “UNSATISFIABLE” when no assignment exists.
Proof.
The probability that the algorithm does not find an assignment
when exists in 2n2 steps is bounded by 12 .
A randomized 3-SAT algorithm
1
Pr (Xi+1 = j + 1|Xi = j) ≥
3
2
Pr (Xi+1 = j − 1|Xi = j) ≤
3
If we assume equalities above and solve as for 2-SAT, we will get
(with Dt being the expected number of steps to termination when
we have t incorrect variable assignments), then we get
D0 = Θ(2n )
This is not good since there are only 2n truth assignments to try.
The problem is that the number of variables that agree with S
becomes smaller over time with high probability.
• If we start from a random truth assignment, then w.h.p. this
agrees with S in n/2 variables (this is the expectation).
• Once we start the algorithm, we tend to move towards 0
rather than n correct variables. Hence we are better off
restarting the process several times and taking only a small
number of steps (3n works as we shall see) before restarting.
A modified algorithm
3j 2 j 1 2j
qj ≥
j 3 3
c 27 j 2 j 1 2j
≥ √ (
j 4 3 3
c 1
≥ √ j
j2
Let q be the probability of reaching a satisfying assignment within
3n steps starting from the random initial assignment (in one
round):
n
X
q ≥ Pr(start with j mismatches with S)qj
j=0
n
1 X n 1 n c 1
≥ + √ j
2n j 2 j2
j=1
n
c 1 n X n 1 j n−j
≥ √ ( (1)
n 2 j 2
j=1
c 1 n 3 n
= √ ( (
n 2 2
c 3 n
= √ (
n 4
If S exists, the number of times we have to repeat the initial
random assignments is a geometric random variable with
parameter q. The expected number of repetitions is q1 .
√ n
Hence, the expected number of repetitions is cn ( 43 so the
3 n
expected number of steps until a solution is found is O(n 2 ( 43 )
If a denotes the expected number of steps above, then, by
Markov’s inequality, the probability that we need more than 2a
steps is at most 21 so if we repeat the outer loop (picking a new
random assignment) 2ab times, then the probability that no
solution is found when one exists is at most 2−b .
Classification of States
Definition
State j is accessible from state i if for some integer n ≥ 0,
n > 0. If two states i and j are accessible from each other we
Pi,j
say that they communicate, and we write i ↔ j.
Lemma
A finite Markov chain is irreducible if and only if its graph
representation is a strongly connected graph.
t = the probability that starting at state i the first transition to
ri,j
state j occurred at time t, that is,
t
ri,j = Pr(Xt = j and for 1 ≤ s ≤ t − 1, Xs 6= j | X0 = i).
Definition
t
P
A state is recurrent if t≥1 ri,i = 1, and it is transient if
t
P
t≥1 ri,i < 1. A Markov chain is recurrent if every state in the
chain is recurrent.
The expected time to return to state i when starting at state j:
X
t
hj,i = t · rj,i
t≥1
Definition
A recurrent state i is positive recurrent if hi,i < ∞. Otherwise, it is
null recurrent.
Example - null recurrent states
∞ ∞
X
t
X 1
h1,1 = t · r1,1 = =∞
t +1
t=1 t=1
Definition
An aperiodic, positive recurrent state is an ergodic state. A
Markov chain is ergodic if all its states are ergodic.
Corollary
Any finite, irreducible, and aperiodic Markov chain is an ergodic
chain.
Example: The Gambler’s Ruin
• Consider a sequence of independent, two players, fair
gambling games.
• In each round a player wins a dollar with probability 1/2 or
loses a dollar with probability 1/2.
• W t = the number of dollars won by player 1 up to (including)
step t.
• If player 1 has lost money, this number is negative.
• W 0 = 0. For any t, E[W t ] = 0.
• Player 1 must end the game if she loses `1 dollars
(W t = −`1 ); player 2 must terminate when she loses `2
dollars (W t = `2 ).
• Let q be the probability that the game ends with player 1
winning `2 dollars.
• If `2 = `1 , then by symmetry q = 1/2. What is q when
`2 6= `1 ?
−`1 and `2 are recurrent states. All other states are transient. Let
lim P`t2 = q.
t→∞
lim P`t1 = 1 − q.
t→∞
`2
X
t
E[W ] = iPit = 0
i=−`1
lim E[W t ] = `2 q − `1 (1 − q) = 0.
t→∞
`1
q = .
`1 + `2