Introduction to statistics Let $X$ be uniformly distributed on $[a,b]$. Find a function $f$ such that $Y=f(X)$ is exponentially distributed with parameter $1$. How do I do this?

Hint:
you know that $$
a<x<b\implies P(X>x) = \frac{b-x}{b-a}
$$and you want
$$
P(f(X)>y) = e^{-y}$$
solution:
assuming that $f$ is one to one and increasing,
$$
e^{-y}=P(f(X)>y) = P(X > f^{-1}(y)) = \frac{b-f^{-1}(y)}{b-a}
\\
f^{-1}(y) = b-(b-a)e^{-y}
$$
And solve for $y=f(x)$:
$$
x=f^{-1}(y) = b-(b-a)e^{-y}\\
f(x) = y=-\log\frac{b-x}{b-a}
$$
Eventually, check that $f$ is one to one and increasing.
