Find the distribution of $Y = -\log (1-X)$ given that $X\sim U(0,1)$. If $X \sim U (0,1)$ then if we define a new random variable $Y=-\log (1-X)$ then what will be distribution of $Y$.
Please explain.
Let $y&gt;0$.

$P(Y\leq y)=P(-\log(1-X)\leq y)=P(\log(1-X)\geq -y)=P(1-X\geq e^{-y})$

Now if $X\sim U(0,1)$, $1-X\sim U(0,1)$ too. So $P(1-X\geq e^{-y})=1-e^{-y}$.

We get the cdf of a standard exponential distribution.
The answers above are right, you find the PDF of a positively-truncated exponential.

In fact, this is one of the most common way to generate (on a computer) numbers following an exponential distribution, assuming that you have a PRNG that produces number $X \sim \mathcal{U}([0,1])$.
See here for more details, and here about the general method (Inverse transform sampling).