# Variance of 2-D random walker

1. Nov 15, 2011

### ragnabob

I've made a 2D walker to compare different RNG's. I'm measuring the succes of each walk as the distance from the origin to the endpoint, using the regular 2-norm. The thing I can't seem to work out is the variance.

$$D_n=\sqrt(x_n^2+y_n^2)$$

$$Var(D_n)=E[D_n^2]=E[Z_1^2+...+Z_n^2]$$

Since $Var(Z_i)=\sqrt{2}$ does this mean that the variance is $2n$? Seems too easy...

Ps. I'm not sure how to make the formatting prettier, if someone can tell me, I'll edit it naturally!
Ps2. Thanks Stephen Tashi!

Last edited: Nov 15, 2011
2. Nov 15, 2011

### Stephen Tashi

On this forum, surround the LaTex with "tags" rather than the dollar sign.

Code (Text):

$$D_n=\sqrt{x_n^2+y_n^2}$$

$$Var(D_n)=E[D_n^2]=E[Z_1^2+...+Z_n^2]$$

Since $Var(Z_i)=\sqrt{2}$ does this mean that the variance is $2n$ ?

$$D_n=\sqrt{x_n^2+y_n^2}$$

$$Var(D_n)=E[D_n^2]=E[Z_1^2+...+Z_n^2]$$

Since $Var(Z_i)=\sqrt{2}$ does this mean that the variance is $2n$ ?

3. Nov 15, 2011

### Stephen Tashi

Another thing about the forum: When you edit a post, sometimes "Save" doesn't display the LaTex. You must refresh the page to accomplish that.

$Var(z_i) = \sqrt{2}$ for the random variable $z_i$ that uses the square of the distance between the current position and the previous position. But this is not the same as using the distance between the current position and $(x_0,y_0)$.

For example, there is the distinction between
$$z_2 = \sqrt{(x_1-x_0)^2 + (y_1-y_0)^2} + \sqrt{( x_2-x_1)^2 + (y_2-y_1)^2}$$

and

$$Z_2 = \sqrt{ (x_2-x_0)^2 + (y_2-y_0)^2}$$

4. Nov 16, 2011

### PatrickPowers

The sum of the variances of independent random variables is the variance of the sum. That should make it easy, unless I'm missing something.