# Suppose that a random walker takes n steps to the right and n′ steps to the left for a total of Nsteps. Each step is of equal length a and the probability of a step to the right is p. Denote x...

Suppose that a random walker takes n steps to the right and n′ steps to the left for a total of N

steps. Each step is of equal length a and the probability of a step to the right is p. Denote x as

the net displacement of a walker after N steps. What is the mean value x for an N-step random

walk? What is the N dependence of the variance (x)2?

*print*Print*list*Cite

If the we know exactly how much steps the walker takes to the right (`n` ) and to the left (`n'` ) and that always the total number of steps is the same

`N =n +n'`

the regardless of the probability of taking a step to the right, the total displacement is the same. If `a` is the length of one step the displacement `X` after `N` steps is

`X = n*a -n'*a =n*a -(N-n)*a =a*(2n -N)`

**since this value is constant, this is also the mean value of total displacement : `barX =a*(2n-N)` **

Now to find the variance of the displacement. As we know the variance of a value is defined as

`barX^2 =(1/N)sum_(i=1)^N (barX-X_i)^2 `

For the value `X_i` we can write the expression

`X_i =p*a-(1-p)*a +X_(i-1) =2pa-a+X_(i-1) =a(2p-1)+X_(i-1)`

Hence we have in sequence

`X_1 =a(2p-1)`

`X_2 =2a(2p-1)`

.......

`X_N =Na(2p-1)`

If we know the total number of steps `n` that the walker takes to the right from the total number of steps `N` then the probability of taking a step to the right is

`p =n/N`

Therefore the variance is

`barX^2 =(1/N)sum_(i=1)^N [a(2n-N)-i*a(2p-1)]^2 `

`barX^2 =(1/N)a^2*sum_(i=1)^N[(2n-N)-i(2n/N-1)]^2`

`barX^2 =(1/N)*a^2*(2n-N)^2*(1/N^2)*sum_(i=1)^N(N-i)^2`

`barX^2 =1/N^2a^2(2n-N)^2*sum_(k=1)^(N-1) k^2 `

The last sum is known

`sum(k=1)^(N-1) k^2 =(1/6)*N*(N-1)*(2N-1)`

Therefore the value of variance is

`barX^2 =(1/6)((N-1)(2N-1))/N*a^2*(2n-N)^2`

**The value of variance of displacement as a function of total steps N is**

`barX^2 =(1/6)*((N-1)(2N-1))/N*a^2*(2n-N)^2`