**dave__w**) I thought it would be fun to answer.

If two points are placed randomly on a one by one square then the distance between them must be somewhere from zero to √2 (1.414).

**Step 1: simplify the question**

Question 2: What is the average distance between two points on a unit *line*? (I plan to refer to my two points as ** X** and

_{1}

**and the distance between them as**

`X`_{2}

**.)**

`Y`

`Y = |X`

_{1} - X_{2}|

Note: The vertical lines (|) represent absolute value and merely mean that the distance is always considered to be positive regardless of whether `X`

or _{1}`X`

is actually larger. This is because distance is an inherently positive value._{2}

**Step 2: simplify the question further**

Question 3: If `X`

is not random and we place it in a known place on our line, what is the average _{1}`Y`

for any random location of `X`

?_{2}

If `X`

is 0, then _{1}`Y`

may be anywhere from 0 to 1 and will be equal to the value of `X`

. Because this is a straight line, the average _{2}`Y`

value should be exactly `.5`

If `X`

is _{1}`.5`

(in the middle of the line), then the placement of `X`

will only allow _{2}`Y`

to vary from 0 to `.5`

. Following the principle that the average value of a line of straight slope is its middle value. The average value of `Y`

where `X`

is _{1} = .5`.25`

.

If `X`

is _{1}`.25`

this situation becomes a bit more complicated. If `X`

is less than _{2}`X`

, _{1}`Y`

will fall between 0 and `.25`

(average value: `.125`

). If `X`

is greater than _{2}`X`

, _{1}`Y`

will fall between 0 and `.75`

(average value: `.375`

) Given that `X`

has a 25% chance of falling to the left of _{2}`X`

, and a 75% chance of falling to the right, the weighted average value of _{1}`Y`

is `.3125`

.

In general, for any particular value of `X`

, the average distance _{1}`Y`

would be equal to the average distance if `X`

is less than _{2}`X`

times the probability that _{1}`X`

actually would be less than _{2}`X`

, plus the average distance if _{1}`X`

is greater than _{2}`X`

times the probability that _{1}`X`

actually would be greater than _{2}`X`

._{1}

Our new formula for average ` Y = `

. This formula can be tested by trying some of the values of **X _{1}^{2} - X_{1} + ^{1}/_{2}**

`X`_{1}

which we have already considered. This is the answer to question 3.**Step 3: Use the answer to question 3 and return to question 2**

Question 2: What is the average distance between two points on a unit line?

We know the answer to the question for any single fixed value of `X`

, and need to calculate the average for all values of _{1}`X`

. This range is not a straight line, so I can't just take the middle value as the average. Here's my formula for the average value of _{1}`Y`

for all values of `X`

from 0 to 1:_{1}

For the integrated function:

this translates to**F(X _{1}) = ^{1}/_{3}X_{1}^{3} - ^{1}/_{2}X_{1}^{2} + ^{1}/_{2}X_{1}**

**[ F(max X**_{1}) - F(min X_{1}) ] / [ max X_{1} - min X_{1} ].

Because we are working with the range of 0 to 1, plugging these two values into the final function yields the answer of

. This is the average distance of two points placed at random on a line of length 1.^{1}/_{3}

This seems to me to be such a simple answer that I suspect I could have gotten this far much more simply. I don't know how though... any ideas?

**Step 4: use the answer to question 2 to answer the main question**

`X`_{1}

and `X`_{2}

(which I will call **Y**_{1}

), and the vertical distance (which I will call **Y**_{2}

) can be related to the actual difference using the formula: **distance ^{2} = Y_{1}^{2} + Y_{2}^{2}**

Because we know the average values of `Y`

and _{1}`Y`

are each _{2}

, we can calculate the average distance:^{1}/_{3}

**distance ^{2} = (^{1}/_{3})^{2} + (^{1}/_{3})^{2}**

**distance ^{2} = ^{2}/_{9}**

**distance = ^{√2}/_{3} = approximately .4714**

**Tags: ** math