Expected value of a piecewise function

211 Views Asked by At

Suppose we have two independent continuous random variables with uniform distribution in the range of [0,b]. The joint PDF function will be $f(x,y)=\frac{1}{b^2}$. I want to compute the expected value of this piecewise function:

$u(x,y) = \left\{\begin{matrix} 0 & x,y < b/2 \\ b/2 & (y<b/2 \quad and \quad x > b/2) \quad or \quad (x < b/2 \quad and \quad y > b/2)\\ x & y,x>b/2 \quad and \quad y>x\\ y & y,x>b/2 \quad and \quad x>y \end{matrix}\right.$

How the Expected Value should be computed? I cannot figure out how to compute the expected value of $u(x,y)$ using the definition of expected value:

$E(u(x,y))=\int_0^b\int_0^bu(x,y)f(x,y)dxdy = \int_0^b\int_0^b\frac{u(x,y)}{b^2}dxdy$

1

There are 1 best solutions below

0
On BEST ANSWER

You can do this with no integration whatsoever, because the joint density is uniform on the support. So the expected value is the volume under the function $u(X,Y)$, divided by the area of the support, which is just $b^2$.

Since there are five piecewise regions, three of which are trivial to compute the volume, we first address the two triangular regions. Clearly, their volumes are equal due to symmetry about the line $y = x$. So we compute just one, say the one with vertices at $$(x, y, u(x,y)) = \{(b/2, b/2, 0), (b, b, 0), (b/2, b, 0)\},$$ for which the height function is $u(x,y) = x$. Then this means that the other three vertices of this volume are $$(x, y, u) = \{(b/2, b/2, b/2), (b, b, b), (b/2, b, b/2)\}.$$ By "slicing" this volume with the horizontal plane $u = b/2$, we easily see that this volume is made up of a right triangular prism and then a tetrahedron, both of height $b/2$ and base area $B = \frac{1}{2}(\frac{b}{2})^2 = \frac{b^2}{8}$. Therefore, the total volume is $$Bh + \frac{1}{3}Bh = \frac{4}{3} \cdot \frac{b^2}{8} \cdot \frac{b}{2} = \frac{b^3}{12}.$$ Therefore, the total volume under $u$ is simply $$0 + 2 \cdot \frac{b^3}{8} + 2 \cdot \frac{b^3}{12} = \frac{5b^3}{12},$$ and the expected value is the total volume divided by $b^2$, or $$\operatorname{E}[u(X,Y)] = \frac{5b}{12}.$$