Choose two points on a line segment (length=1) randomly.What is the expected value of the distance between the two points?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let the two points be x and y ; then the distance between the points is ∣ x − y ∣ . To find its expected value, we can integrate ∣ x − y ∣ over the region { 0 ≤ x ≤ 1 , 0 ≤ y ≤ 1 } and then divide by the area of that region; however in this case the area is 1 so we can forgo the division.
∫ 0 1 ∫ 0 1 ∣ x − y ∣ d y d x = ∫ 0 1 ∫ 0 x ( x − y ) d y d x + ∫ 0 1 ∫ x 1 ( y − x ) d y d x = ∫ 0 1 ( x y − 2 y 2 ) ∣ ∣ ∣ ∣ 0 x d x + ∫ 0 1 ( 2 y 2 − x y ) ∣ ∣ ∣ ∣ x 1 d x = ∫ 0 1 ( x 2 − 2 x 2 ) d x + ∫ 0 1 ( 2 1 − x ) − ( 2 x 2 − x 2 ) d x = ∫ 0 1 ( x 2 − x + 2 1 ) d x = ( 3 x 3 − 2 x 2 + 2 x ) ∣ ∣ ∣ ∣ 0 1 = ( 3 1 − 2 1 + 2 1 ) = 3 1
I wasn't able to create a 3-D graph of the integral, but if you can visualize it, it's not hard to see that it consists of two congruent pyramids, so we could have just calculated the first half of the above integral and doubled the answer, which would have shortened the work considerably.