TITLE: What is the new probability density function by generating a random number by taking the reciprocal of a uniformly random number between 0 and 1?
QUESTION [10 upvotes]: I have a random number generator which can generate a random number between $0$ and $1$.
I attempt to generate a random number between 1 and infinity, by using that random number generator, but taking the reciprocal of that result.
Is the new generator uniform? Certainly not. Then what is the probability density function of the new generator?

REPLY [13 votes]: Denote with $U$ the random number you generate, then $U\sim U(0,1)$ and you want to determine the distribution of $Y=\frac{1}U$. So, for $1\le y<+\infty$, you have that $$F_{Y}(y)=P(Y\le y)=P(1/U\le y)=P(U\ge 1/y)=1-P(U<1/y)=1-F_U(1/y)$$ Hence $$f_Y(y)=\frac{d}{dy}F_Y(y)=\frac{d}{dy}\left(1-F_U(1/y)\right)=\frac1{y^2}f_U(1/y)=\frac1{y^2}\cdot1=\frac1{y^2}\mathbf{1_{y\ge1}}$$