Flaw in conditional expectation shortcut

79 Views Asked by At

The problem is simple: given 2 independent uniform random variables $X, Y$ over $[a, b]$, find $\mathbb{E}[X - Y \ | \ X > Y]$.

My intuitive approach is to first fix $Y = y$, then for this specific case, we have $$\mathbb{E}[X - y \ | \ X > y] = \mathbb{E}[X - y \ | \ X \in [y, b]] = \dfrac{b+y}{2} -y = \dfrac{b-y}{2}$$

Now we can integrate over $Y = y \in [a, b]$ to get: $$ \begin{align} \mathbb{E}[X - Y \ | \ X > Y] &=\int_a^b \mathbb{E}[X - y \ | \ X \in [y, b]] \cdot \dfrac{1}{b-a} \ \mathrm{d}y \\ &= \int_a^b \dfrac{b-y}{2} \cdot \dfrac{1}{b-a} \ \mathrm{d}y \\ &= \dfrac{b-a}{4} \end{align} $$ which is wrong, as the correct answer (verified computationally) should be $\dfrac{b-a}{\color{red}3}$.

What is the flaw in my logic?

3

There are 3 best solutions below

0
On BEST ANSWER

You are trying to claim that $\mathsf E(X-Y\mid X>Y)=\mathsf E(\mathsf E(X-y\mid X>y)_{y:=Y})$ but

$$\begin{align}\mathsf E(\mathsf E(X-y\mid X>y)_{y:=Y})&=\int_a^bf_Y(y)\dfrac{\int_y^b~(x-y)~f_{X}(x)~\mathrm d x}{\mathsf P(X>y)}~\mathrm d y\tag{RHS}\\&=\int_a^b \dfrac{1}{b-a}\int_y^b\dfrac{(x-y)}{(b-y)}\mathrm d x\mathrm d y\\&=\int_a^b\dfrac{b-y}{2(b-a)}\mathrm d y\\&=\dfrac{b-a}{4}\end{align}$$

Where as:

$$\begin{align}\mathsf E(X-Y\mid X>Y) &=\dfrac{\int_a^b\int_y^b (x-y)~f_{X}(x) f_Y(y)~\mathrm d x~\mathrm d y}{\mathsf P(X>Y)}\tag{LHS}\\&=\dfrac{1}{2}\int_a^b\int_y^b\dfrac{(x-y)}{(b-a)^2}~\mathrm d x~\mathrm d y\\&=\int_a^b \dfrac{(b-y)^2}{2(b-a)^2}~\mathrm dy\\&=\dfrac{b-a}{3}\end{align}$$

0
On

You are misapplying the rule, valid for $X$, $Y$ independent, $$E[h(X,Y)]=\int E[h(X,y)]f_Y(y)\,dy.$$ The rule is valid when evaluating the expectation of a function $h(X,Y)$ of $X$ and $Y$, such as $h(X,Y):=X-Y$, but it does not apply to $h(X,Y):= X-Y\mid X>Y$, which is not a function of $X$ and $Y$.

0
On

I am using the following:

$$ \mathbb{E}[g(X,Y) \ | \ r(X,Y) ] = \iint g(x,y) \ f(x,y \ | \ r(x,y)) \ \mathrm{d}x \ \mathrm{d}y $$ where:

  • $g(X,Y)$ is a function of $X, Y$, in my case $g(X,Y) := X - Y$
  • $r(X,Y)$ is the region we condition on, in my case $r(X,Y) := X > Y$

Now we need the conditioned PDF: $$ f(x,y \ | \ x > y) = \dfrac{f(x,y)}{p(X > Y)} = \dfrac{2}{(b-a)^2} $$ for $a \leq y \leq x \leq b$.

and we can proceed with the integration: $$ \begin{align} \mathbb{E}[X - Y \ | \ X > Y ] &= \int_a^b \int_y^b (x-y) \ f(x,y \ | \ x > y) \ \mathrm{d}x \ \mathrm{d}y \\ &= \int_a^b \int_y^b (x-y) \ \dfrac{2}{(b-a)^2} \ \mathrm{d}x \ \mathrm{d}y \\ &= \dfrac{b-a}{3} \ \ \blacksquare \end{align} $$