Compute average distance between numbers $0$ to $10$ 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$?

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.
