0

I have to solve this exercise and I have no idea how to do it... Help is highly appreciated.

We make the following experiment: we ask 2 persons to write one real number from [0, 5] each on a paper, and then we calculate the distance between these numbers. We assume that people choose numbers uniformly from that interval, and also that the choices are independent. If we will repeat this experiment many times, independently asking each time 2 persons, and if we will calculate then the average of the calculated distances, what will be the approximate value of that average?

3 Answers3

4

Let the random variables be $X$ and $Y$. Note that $\mathbb{E}(\min \{X, Y \}) = \frac{5}{3}$, and $\mathbb{E}(\max \{X, Y \}) = \frac{10}{3}$. So the average distance is $\frac{5}{3}$.

Another approach: I will replace $5$ with $1$; we will just multiply $5$ at the end. Suppose person 1 chooses $x$. Then there is a probability $x$ of person 2 choosing between 0 and $x$, with expected distance $\frac{x}{2}.$ The probability of choosing above $x$ is $1-x$ with average distance $\frac{1-x}{2}.$ So the average distance for a given $x$ is $\frac{x^2+(1-x)^2}{2} = x(x-1)+\frac{1}{2}$. Integrating from $0$ to $1$ gives a final value of $\frac{1}{3}$, and multiplying back the $5$ gives $\frac{5}{3}$ as an average.

Another approach; we integrate the probability:

\begin{align} &\int_0^5\int_0^5|x-y|\,dx\,dy\\ =&\int_0^5\left[\int_0^y(y-x)dx+\int_y^5(x-y)dx\right]dy\\ =&\int_0^5\left[\left[xy-\frac{1}{2}x^2\right]_0^y+\left[\frac{1}{2}x^2-xy\right]_y^5\right]dy\\ =&\int_0^5\frac{1}{2}y^2+\frac{25}{2}-\frac{1}{2}y^2-5y+y^2dy\\ =&\left[\frac{25}{2}y-\frac{5}{2}y^2+\frac{y^3}{3}\right]_0^5\\ =&\frac{125}{3} \end{align}

Put this over $25$ (the area of the region we integrated over) to arrive at $\frac{5}{3}$ as the final answer.

auscrypt
  • 8,186
1

For real numbers $X$ and $Y$:

There are two regions in the $(x,y)$ plane and the formula for distance is different in the two regions (unless you use an absolute value, which is tricky to cope with in an integral).

The total region in $(x,y)$ space is $5 \times 5 = 25$ and the answer becomes

$$\frac1{25} \left( \int_{x=0}^5 \int _{y=0}^x (x-y) dy\,dx+ \int_{x=0}^5 \int _{y=x}^1 (y-x) dy\,dx\right)\\= \frac1{25} \left( \int_{x=0}^5 \frac{x^2}{2}\,dx + \int_{x=0}^5 \frac{x^2}{2}\,dx \right)= \frac1{25} \int_{x=0}^5 x^2dx = \frac53 $$


For discrete integers:

There are $6\times 6=36$ possible combinations (pairs) of numbers and it would not be very difficult to write out the differences for each pair, add them up and divide by $36$.

I like to do this problem differently: Let person $A$ choose his number by rolling a fair 6-sided die and subtracting $1$ from th3e roll. Let person $B$ choose her number by rolling a six-sided die and subtracting the roll from $6$.

Then the (signed) difference between the two numbers chosen is equal to the sum of the two dice rolls, mius $7$. Since the distribution of the sum of two dice is $(P2\cdots 12) =\frac1{36}(1,2,3,4,5,6,5,4,3,2,1)$ the average distance is $$ \frac1{36}(1\cdot 5+ 2\cdot 4+3\cdot 3 + 4\cdot 2 + 5\cdot 1 + 0 + 5\cdot 1 + 4\cdot 2 + 5\cdot 1 + 0 + 5\cdot 1 + 3\cdot+ 3 2\cdot 4+1\cdot 5) = \frac{70}{36}=1\,\frac{17}{18} $$ This answer is a bit larger than $\frac53$ because more of the integer distributin is found at the very edge of the region.

Mark Fischler
  • 41,743
1

As correctly pointed out in the comments by David Peterson, you're looking for $E(|X-Y|)$ where $X, Y \sim U(0,5)$.

Now since the two random variables are independent, their PDF is given by the product of their marginal distributions, i.e.,

$$f_{X,Y}(x,y) = f_{X}(x) f_{Y}(y)$$

Now in order to calculate, $E(|X-Y|$,

$$E(|X-Y|) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} |x-y| f_{X}(x) f_{Y}(y) dx dy$$

Have left out the details for you to work them out.

Vizag
  • 3,257