2D Random Walk: Average distance after 2 steps

A simulation of 50,000 iterations gives the average distance after a 2-step (unit step) random walk on a 2 dimensional plane, which is around 1.27. But how can one mathematically prove this?

Any insight is highly appreciated!

• Are you just walking on the usual lattice? Makes a significant difference in the result. – lulu Apr 6 at 23:16
• Are your steps always north, east, south, or west, or can they be in any direction? My answer assumes any direction, while kimchi lover assumed the other. – Ross Millikan Apr 6 at 23:16
• The question assumes walking in any direction. I'm sorry for the confusion and thank you to anyone who contributed ideas/thoughts/comments! – CminorDmax Apr 7 at 1:59

You can rotate the coordinates so the first step is to $$(1,0)$$. If the second step is at angle $$\theta$$, the end point is then $$(1+\cos \theta,\sin \theta)$$. The distance from the origin is then $$\sqrt{(1+\cos \theta)^2+\sin^2\theta}=\sqrt{2+2\cos \theta}$$ The average of this over $$\theta$$ is $$\frac 1{2\pi}\int_0^{2\pi}\sqrt{2+2\cos \theta}d\theta=\frac 8{2\pi}\approx 1.2732$$
I get $$\frac{0+2\sqrt 2 + 2} 4 \approx 1.207$$ as the expected distance. The first step moves you to distance $$1$$ from the origin. The next step goes back to the origin with probability $$1/4$$, goes sideways with probability $$1/2$$, and goes in the same direction with probability $$1/4$$.
First step in any direction. Second step has four choices (assume equally probable), left, right, forward, and backward. The four eqiproable distances from start are $$\sqrt{2}, \sqrt{2},2,0$$. The average is $$1..2071$$