# Use the change of variables to determine the density for a uniform distribution on $[a,b]$

Knowing that the density of a uniform random variable on $$[0,1]$$ is:

$$f_{U}=\left\{\begin{matrix} 1 & x\in [0,1]\\ 0 & x\notin[0,1] \end{matrix}\right.$$

How to determine the density of a uniformly distributed random variable on $$[a,b]$$ using change of variable?

• Hint: If $U$ is a random variable on $[0, 1]$, then what distribution does $(b-a)U+a$ have? – angryavian Feb 18 at 4:07
• I know how to do this by what you said, but does is use the change of variable? Uniform dist is pretty simple so you know the pdf is 1/(b-a) and make a random variable Y=(b-a)X+a and get this pdf. But what if you don't know the pdf? I know this problem itself is somehow weird – suntoto Feb 18 at 5:18
• I understood. When constructing Y=(b-a)X+a, we consider it as a scaling and shifting of X, so Y is still a uniformly distributed RV and its domian is therefore [a,b], right? – suntoto Feb 18 at 5:24
• You know the density of $U$, so you can use change of variables on $f_U$ to get the density of $(b-a)U +a$. – angryavian Feb 18 at 5:31

Denote the described variable by x. Construct new variable y as $$y = (b-a)x+a$$
For any value z, The cumulative density function $$F(y \leq z) = F(x \leq \frac{z-a}{b-a}) = \begin{cases} 0, \, z< a\\ (z-a)/(b-a), \, z \in [a,b]\\ 1, \, z > b \end{cases}$$
Take the derivative of cdf with respect to z, the pdf $$f(y=z) = \begin{cases} 1/(b-a), z \in [a,b]\\ 0, otherwise \end{cases}$$