Changing random variable in uniform distribution

904 Views Asked by At

Let $X\sim U([1,2])$ and $Y=\frac{1}{X}$

How do I calculate the mean of Y?

I know that

$$f(x)=\begin{cases}1 & \text{ if } 1\leq x\leq 2 \\ 0& \text{ otherwise } \end{cases}$$

Does that mean that

$$f(y)=\begin{cases}1 & \text{ if } 1\leq \frac{1}{y}\leq 2 \Leftrightarrow \frac{1}{2}\leq y\leq 1\\ 0& \text{ otherwise } \end{cases}$$

if so then the mean value should be:

$$\int_{1/2}^{1}y=\int_{1/2}^{1}\frac{1}{x} dx$$

Is this correct?

2

There are 2 best solutions below

1
On

Use the transformation formula

$$p(Y)=p(X)\left|\frac{dX}{dY}\right|=\frac{1}{Y^2}$$ where $Y \in [\frac{1}{2},1]$

So $$E[Y]=\int_{1/2}^1 Y\frac{1}{Y^2}dY=\int_{1/2}^1\frac{1}{Y}dY=\ln1-\ln\frac{1}{2}=\ln 2$$

0
On

By the Law of the unconscious statistician,

$$ \mathbb{E}[Y] = \mathbb{E}\left[\frac{1}{X}\right] = \int_\mathbb{R} \frac{1}{x} f_X(x)dx = \int_1^2 \frac{1}{x} dx = \ln 2 $$ since $f_X(x) = \begin{cases}1 &\text{ if } 1\leq x\leq 2\\0& \text {otherwise.}\end{cases}$