# Function of random variables: the ratio of two bounded random variables

If x,y and z are continuous random variables.

$$f_X(x)=2ax\exp(-ax^2+aR^2)\ \ \ R<x<\infty \\ f_Y(y)=\frac{2by\exp(-by^2)}{1-\exp(bR^2)} \ \ \ 0<y<R \\$$ where $R$,$a$ and $b$ are positive real numbers. $$z=\frac{x}{y}$$ and we want to find the $CDF$ 'Cumulative Distribution Function' of z?

This is the question. I tried to solve it but without success. Here is my attempt:

First we need to find the range of z which is $1<z<\infty$

Then, $$F_Z(z)=\int\limits_{0}^{R}\int\limits_{R}^{zy} f_X(x)f_Y(y)dxdy$$ And the final answer using mathematica: $$F_Z(z)=\frac{b e^{R^2 (a+b)} \left(e^{-R^2 \left(a z^2+b\right)}-1\right)}{\left(e^{b R^2}-1\right) \left(a z^2+b\right)}+1$$ Since this is a CDF then it must start at $0$ and end at $1$.

@ $z= \infty$, $F_Z(z) =1$ which is correct, but when $z=1$ it doesn't equal $0$!! Where is the mistake.

I plotted the function using some values for a,b and R (these values don't make a difference since it should be valid for all the values) and here is the plot:

-

The limits of the inner integral defining $F_Z(z)$, from $x=R$ to $x=zy$, are incorrect. If $zy\gt R$, no problem. But, if $zy\lt R$, this integral should be zero. Using the limits $x=R$ and $x=zy$ yields a negative contribution which explains the negative values of your plot. Equivalently, the inner integral should go from $x=R$ to $x=\max\{zy,R\}$.
Makes sense, I changed the outer integration limits to make sure that $zy>R$ always, so I set it from $R/z$ to $R$, and it worked, Thanks. –  Alammouri May 27 '14 at 17:13