clovnerie0q

2022-10-09

What is the expected distance between endpoints of n line segments of length 1 connected at random angles?
Start at the origin and take n line segments and connect them end to end each at random angles. What is the expected distance of the endpoint from the origin of the resulting path?
Clearly when $n=1$ the expected distance is 1. When $n=2$ we can find the expected distance by integrating
$\frac{1}{2\pi }{\int }_{0}^{2\pi }2\mathrm{sin}\left(\frac{x}{2}\right)dx=\frac{4}{\pi }$
For $n=3$, it is easy to simulate and find the distance is approximately 1.58. For $n=4$ the simulated distance is 1.82 and for $n=5$ we get approximately 2.02.
Can one find a general formula for any n?

Paige Paul

Step 1
Let each line segment be a unit vector
$$
Adding up n unit vectors gives the resultant vector from the beginning to the end of the string
$\sum _{k=1}^{n}$
The magnitude of the resultant vector is the distance from beginning to end
$D=|<\sum _{k=1}^{n}cos\left({\theta }_{k}\right),\sum _{k=1}^{n}sin\left({\theta }_{k}\right)>|$
Step 2
That equals
$\sqrt{\left(\sum _{k=1}^{n}cos\left({\theta }_{k}\right){\right)}^{2}+\left(\sum _{k=1}^{n}sin\left({\theta }_{k}\right){\right)}^{2}}$
To find the average distance, we need to add up the distances from every possible combination of thetas and divide by the number of combinations. Since each theta can be any value between 0 and 2 pi, we use an integral
$\frac{1}{\left(2\pi {\right)}^{n}}{\int }_{0}^{2\pi }\dots {\int }_{0}^{2\pi }\sqrt{\left(\sum _{k=1}^{n}cos\left({\theta }_{k}\right){\right)}^{2}+\left(\sum _{k=1}^{n}sin\left({\theta }_{k}\right){\right)}^{2}}d{\theta }_{1}\dots d{\theta }_{n}$
Solve that and you get your average distance for any n

Do you have a similar question?