# correct limits of integration

I just want to clarify where did the $1/4$ come from?

Let $X$ denote the diameter of an armored electric cable and $Y$ denote the diameter of the ceramic mold that makes the cable. Both $X$ and $Y$ are scaled so that they range between $0$ and $1$. Suppose that $X$ and $Y$ have the joint density

$$f(x, y) =\begin{cases} \frac1y,&0<x<y<1\\\\ 0,&\text{elsewhere} \end{cases}$$

Solution:

\begin{align*} &P\left(X+Y>\frac12\right)=1-P\left(X+Y<\frac12\right)=1-\int_0^{1/4}\int_x^{1/2-x}\frac1y dy\,dx\\ &=\left. 1-\int_0^{1/4}\left[\ln\left(\frac12-x\right)-\ln x\right]dx=1+\left[\left(\frac12-x\right)\ln\left(\frac12-x\right)-x\ln x\right]\right\vert_0^{1/4}\\ &=1+\frac14\ln\left(\frac14\right)=0.6534. \end{align*}

-

Since $0\le X,Y\le 1$, the region on which $X+Y<\frac12$ is the the triangle bounded by the axes and the line $x+y=\frac12$. To integrate over this region, you’d normally set up the integral like this:

$$P\left(X+Y<\frac12\right)=\int_0^{1/2}\int_0^{1/2-x}f(x,y)dy\,dx\;.$$

However, in this case you know that $f(x,y)=0$ when $y\le x$, so you can ignore any part of the triangle lying below the diagonal $y=x$. Thus, the region over which you need to integrate is actually the triangle bounded by $x=0$, $y=x$, and $x+y=\frac12$, which is shaped roughly like this: $\triangleright$. Everywhere else, $f(x,y)=0$. The righthand vertex of that triangle is at the point $\left\langle\frac14,\frac14\right\rangle$, so you need only run $x$ from $0$ to $1/4$.

-
@David: Yes; I was concentrating so much on the $1/4$ aspect that I forgot to change if. Thanks. –  Brian M. Scott Feb 17 '12 at 4:41

As pointed out by Brian M. Scott, the region over which we need to integrate is the triangle with corners $(0,0)$, $(\frac{1}{4},\frac{1}{4} )$, and $(0,\frac{1}{2})$. I would like to point out a slightly different approach to the double integral that perhaps makes the integration easier.

You integrated first with respect to $y$, and then with respect to $x$. That has the disadvantage that you first get something that involves a couple of logarithms, which you then must integrate again.

Let us explore the alternative of integrating first with respect to $x$. Then the first integration will be trivial, since $1/y$ can be treated as a constant.

The downside (look at the picture!) is that for $0 \le y \le \frac{1}{4}$, $x$ goes from $0$ to $y$, while for $\frac{1}{4}\le y\le \frac{1}{2}$, $x$ goes from $0$ to $\frac{1}{2}-y$. So we will have to evaluate two integrals. We now do this, to show it is not hard.

First we evaluate $$\int_{y=0}^{\frac{1}{4}}\left(\int_{x=0}^y\frac{dx}{y}\right)dy.$$ Very easily, the inner integral is $1$, so our integral is $\dfrac{1}{4}$. Next we evaluate $$\int_{y=\frac{1}{4}}^{\frac{1}{2}}\left(\int_{x=0}^{\frac{1}{2}-y}\frac{dx}{y}\right)dy.$$ The inner integral is $\dfrac{1}{2y}-1$, so our integral is $(1/2)(\ln(1/2)-\ln(1/4)) -(1/2-1/4)$. This simplifies to $(1/2)\ln 2-1/4$. Add the two parts. We get $(1/2)\ln 2$. Finally, as in your calculation, the answer to the original question is $1-(1/2)\ln 2$.

Remark: That was easy, but in fact one can do better, by making the change of variable $w=x+y$.

-