# Quod Erat Demonstrandum

## 2009/05/23

### 點數差的期望值

Filed under: Additional / Applied Mathematics,HKALE,HKCEE,mathematics — johnmayhk @ 3:03 下午

$X ,Y$ 分別是兩顆骰子的點數，則要求的是 $E(|X- Y|)$，即是說當 $X \ge Y$ 時，求的是 $E(X - Y) = E(X) - E(Y) = 3.5 - 3.5 = 0$，當 $X \le Y$ 時，求的是 $E(Y - X) = E(Y) - E(X) = 3.5 - 3.5= 0$，即是說，無論哪一種情況，答案也是零。

$P(0) = \frac{6}{36}$
$P(1) = \frac{10}{36}$
$P(2) = \frac{8}{36}$
$P(3) = \frac{6}{36}$
$P(4) = \frac{4}{36}$
$P(5) = \frac{2}{36}$

## 5 則迴響 »

1. E(X-Y) = E(X)-E(Y) = 0;
E(|X-Y|) = E(X-Y|X>Y)P(X>Y) + E(X-Y|X=Y)P(X=Y) + E(Y-X|X<Y)P(X<Y);
Since on the RHS, 1st and 3rd term is non-zero trivially and 2nd term is zero, the LHS is non-zero.

迴響 由 Adrian Tam — 2009/05/23 @ 7:29 下午 | 回應

2. Thank you Adrian Tam and thank you for leaving your website:

the name “Integrable differential" is quite interesting.

Just another related question to the post:

Select two values independently and uniformly from [0,1], what is the expected distance between two values? I can use double integral to obtain the value $\frac{1}{3}$, but can we just consider the symmetry of distribution to obtain the result? Let me explain a bit.

Suppose two numbers divide [0,1] into three subintervals with lengths $l_1, l_2, l_3$, is it true to say that $l_1, l_2, l_3$ have the same distribution? If so, by using the fact that $E(l_1) = E(l_2) = E(l_3)$ and $l_1 + l_2 + l_3 = 1$, it is easy to obtain $E(l_2) = \frac{1}{3}$. But how to explain, without advanced mathematics (e.g. double integral something), $l_1, l_2$ have the same distribution? Or, they actually have different distribution indeed?

迴響 由 johnmayhk — 2009/05/23 @ 8:14 下午 | 回應

3. For the question about [0,1], the answer \frac{1}{3} is correct and the study about similar problem is called “Order Statistics".

On your specific question, let me try with a simple way:
Let the first value in [0,1] is X, and the second value is Y. Find Min(X,Y): Min(X,Y)=X iff Y\ge X, which has probability of 1-X. Min(X,Y)=Y is therefore has the probability of X.
E(Min(X,Y))
=E[E(Y|Y<X)X+E(X)(1-X)]
=E[\frac{X}{2}X+X(1-X)]
=E[X-\frac{1}{2}X^2]
=\int_0^1 (x-\frac{1}{2}x^2)dx
=\frac{1}{2}-\frac{1}{6}
=\frac{1}{3}

迴響 由 Adrian Tam — 2009/05/24 @ 8:06 上午 | 回應

In your solution, is it true in saying

Min(X,Y) = E(Y|Y<X)X+E(X)(1-X)?

Another way to solve the problem is quite traditional, (no double integral of course) let Z = min{X,Y}, it is easy to write down P(Z <= z) and by differentiation, the p.d.f. of Z can be found and hence E(Z) can be calculated. Well, the way is still clumsy. I still wondering that: can the problem be solved 'intuitively' (without calculation)?

Thank you again!

迴響 由 johnmayhk — 2009/05/29 @ 5:51 下午 | 回應

• I think $min(X,Y)=E(Y|Y<X)X+E(X)(1-X)$ in distribution.

For "intuitive" method I don't know. But a "heuristic", "qualitative" explanation is the following: Throw $n$ dots into [0,1] randomly, what you expect is that, the $n$ dots placed evenly on the region, so each slice is $\frac{1}{n+1}$. This reasoning is what I learned in the engineering school about noise in wireless communication.

迴響 由 Adrian Tam — 2009/05/30 @ 4:57 上午 | 回應