1
$\begingroup$

I'd like to calculate the average difference between two numbers, each between $0$ and $10$. I calculated this for integers and came up with an average distance of $4$.

My method: there are $10$ ways to obtain a difference of $1$, $9$ ways to obtain a difference of $2$, $3$ of $8$, $4$ of $7$, $5$ of $6$, $6$ of $5$, etc. I took the weighted average of all the possibilities and I ended up with $\frac{220}{55} = 4$.

But I actually have float values between $0$ and $10$. If I did the integer average distance correctly, is the average distance between $0$ and $10$ continuous still $4$?

  • 0
    I don't think averages are well-defined across infinite sets.2017-01-04
  • 1
    it should be 10/32017-01-04
  • 0
    It does not really matter to you, since you want the solution for real numbers rather than integers, but the average distance between two integers is less than 4 if the integers are chosen uniformly and independently, because there is a 1/11 probability that the difference will be zero.2017-01-04
  • 0
    Thanks! I've checked out [link](http://math.stackexchange.com/questions/195245/average-distance-between-random-points-on-a-line) and that might solve my problem provided it works for continuous. So, if I may, can we agree that the continuous solution is equal to the discrete solution, given symmetry?2017-01-04

1 Answers 1

1

Every pair of numbers between $0$ and $10$ can be associated with a unique point $(x,y)$ in the square $[0,10] \times [0, 10]$. For such a point, the function $f(x,y)=|x-y|$ measures the difference between the two numbers. To find the average value of that function, one computes $$ \frac{1}{100}\int_0^{10} \int_0^{10} |x-y| dx dy $$

The integral is the continuous analog of "summing" all of the integer values; the $100$ measures the area of the square region, which is the continuous analog of the "number" of integer values.

  • 0
    Thanks! I'll play with that a bit.2017-01-04
  • 0
    Okay, I got 3.33 for this definite integral, which is the same solution as for the discrete as given above, which was 10/3.2017-01-04
  • 1
    Yes, that's right. See also the link in dxiv's comment under your question.2017-01-04