2 minute read

The SettingPermalink

There is a system with n possible states/values. At each step, the state changes probabilistically.

Let Xt be the state of the system at time t

So the evolution of the system is: X0,X1,X2,,Xt, and X0 is the initial state.

The system is memoryless: the probability that Xt is in a certain state is determined by the state of Xt1:

Pr[Xt=x|X0=x0,X1=x1,,Xt1=xt1]=Pr[Xt=x|Xt1=xt1]

For simplicity, we assume that:

  • Finite number of states
  • The underlying graph is strongly connected: for any two states, there is a path from 1 to 2 and a path from 2 to 1

Mathematical Representation of the EvolutionPermalink

In general, if the initial probabilistic state is [p1 p2  pn]=π0, where pi is the probability of being in state i, pi=1, and the transition matrix is T, such that:

T[i,j]=Pr[X1=j|X0=i]

After t more steps, the probabilistic state is:

[p1 p2  pn]Tt

And the probability of bing in state i after t steps is:

πt[i]=(π0Tt)[i]

Some PropertiesPermalink

  1. Suppose the Markov chain is “aperiodic”, then as the system evolves, the probabilistic state converges to a limiting probabilistic state:
As t[p1 p2  pn]TtππT=π

So the resulting π is called stationary/invariant distribution, which is unique.

  1. Let Tij be the time of reaching state j when you start at state i, then:
E[Tii]=1π[i]

This is known as the Mean Recurrence Theorem.

Example: The Connectivity ProblemPermalink

Given a undirected graph G=(V,E),|V|=n,|E|=m, and s,tV, check if there is a path from s to t.

It is easy to do in polynomial time with BFS or DFS, but how about using only O(logn) space?

Here is a possible randomized algorithm:

v = s
for k = 1,2,...,N:
    v = random-neighbor(v)
    if v == t, return YES
return NO

For N=poly(n), then this uses O(logn) space.

But what is the success probability? If s and t are disconnected, we give the correct answer.

What if s and t are connected?

If we have a graph A represented by the following adjacency matrix, and we start at any vertex and randomly walk to a neighbor, how does the transition matrix look like?

A=(0111101011011010)thenT=(01/31/31/31/201/201/31/301/31/201/20)

The stationary distribution is:

π=[deg(1)2m,deg(2)2m,deg(3)2m,,deg(n)2m]

So

E[Tii]=2mdeg(i)

What we care is really E[Tij], where i and j are connected.

We pick a path from i to j: i=i1,i2,i3,,ir=j (rn)

E[Tij]E[Ti1i2+Ti2i3++Tir1ir]=E[Ti1i2]+E[Ti2i3]++E[Tir1ir]2m+2m++2m=2mnn3

Why E[Tuv]2m?

E[Tvv]=2mdeg(v)=i=0kPr[first step v to ui]E[Tvv|first step v to ui]=i=0k1deg(v)(1+E[Tuiv])1deg(v)(1+E[Tu0v])2m1+E[Tuv]E[Tuv]2m

So if we set N in the algorithm to be 1000n3, then:

Pr[error]=Pr[Tst>1000n3]11000

by Markov’s inequality.

Comments