I am new to probability theory. In computer programming, I often use the uniform random number in $(0,1)$ $$ U= Unif(0,1) $$ what is the probability density of $U^2$?
In general, how to find the probability of $\sqrt{U}, \ln{U}, \frac{1}{U}$, etc?
I am new to probability theory. In computer programming, I often use the uniform random number in $(0,1)$ $$ U= Unif(0,1) $$ what is the probability density of $U^2$?
In general, how to find the probability of $\sqrt{U}, \ln{U}, \frac{1}{U}$, etc?
On
I will illustrate how to deal with $U^2$ and leave the rest as an exercise.
First think of what are the possible range of values that $U^2$ can take.
Suppose $t \in (0,1)$,
\begin{align} Pr(U^2 \le t) &= Pr (U \le \sqrt{t}), \\ &= \sqrt{t} \end{align}
Now, you just have to diffferentiate it to recover the pdf.
The law of the unconscious statistician (https://en.m.wikipedia.org/wiki/Law_of_the_unconscious_statistician) may be what you're looking for. It says that $$ \mathbb{E}(g(X)) = \int_{-\infty}^\infty g(x) f(x) \ dx $$ Or for discrete random variables $$ \mathbb{E}(g(X)) = \sum_{i\in S} g(i) \mathbb{P}(X=i)\ dx $$ This allows you to compute the expectation and variance of various transforms of a given random variable $X$.