# Finding the Linear Function $g(x)$ Such That $g(x) \sim \text{Unif}(0,1)$

I'm working on the following problem and could use some help getting started.

Let $X \sim \text{Unif}(a,b)$. Find the linear function $g(x)$ such that $g(x) \sim \text{Unif}(0,1)$.

Up until this problem, I was given some function $Y=g(X)$ and asked to find the probability density function $f_Y (y)$ given a specified distribution. The previous problem I solved was the following:

Let $X \sim \text{Unif}(0,1)$. Find $f_Y (y)$ if $Y=X^n$ for $n \in \Bbb N$.

I understand how to find the PDF here, given the function $Y=g(x)$. My result for the PDF here is:

$$f_Y (y) = \cases{\frac{1}{nY^{\frac{1}{n} - 1}} \, \, \, \text{for} \, \, 0<Y<1 \\ \, \, \, \, \, \, \, 0 \, \, \, \, \, \, \, \, \, \text{otherwise}}$$

But, I do not understand how to find $g(x)$ given the information in the first problem.

Thank you~

Guide:

Let $Y=cX+d$ where $c \ne 0$.

consider $2$ cases, case $1$: $c>0$.

Then if $X \in (a,b)$, then $Y \in (ca+d, cb+d)$.

Let $y \in (ca+d, cb+d),$ [Remark: if you aware that linear transformation of uniform distribution is still a uniform distribution, just think of how to map $ca+d$ to $0$ and $cb+d$ to $1$, if not do the following.]

\begin{align}Pr( Y \le y) &= Pr(cX+d \le y)\\ &=Pr(X \le \frac{y-d}c)\\ &=\left( \frac{y-d}c-a\right)\frac{1}{b-a}\\ &= \frac{y}{c(b-a)} - \frac{a}{b-a}-\frac{d}{c(b-a)} \end{align}

We require $c(b-a)=1$ and $ac+d=0$, hence you can solve for $c$ and $d$.

Remember to take care of the case where $c<0$.

• So this makes sense, but I'm a little confused on how you went from $Pr(X\le (y-d)/c)$ to the subsequent step. I've done a little bit with evaluating probabilities like this earlier in the course, but I'm still fuzzy on it. – Kosta Mar 28 '18 at 2:54
• I use the CDF of $X$, that is $Pr(X \le x) = \frac{x-a}{b-a}$ – Siong Thye Goh Mar 28 '18 at 2:56
• Oh, I see. Thank you for the quick reply! – Kosta Mar 28 '18 at 2:58

Very good question. One that I hope will further your understanding of the subject.

See, we have an interesting inverse problem here. As you are pointing out, rather than asking you to find the PDF of a function of a random variable, we are being asked to find a function, which when applied on the random variable, gives another random variable. It's a Google Maps-like question : I know my current location and destination, and I'd like to find the route that gets me to my destination.

To do this question, let us first start with what we do know. $X \sim U(a,b)$. Furthermore, we are given that $g$ is a linear function. What this means, is that there are constants $c,d$ such that $g(y) = cy+d$ for all $y$. In particular, if $c \neq 0$, $g$ has an inverse function, $g^{-1}(z) = \frac{z-d}{c}$. If $c = 0$, then $g = d$ is a constant function, but then, $g(X)$ will also be a constant random variable, but this is not the case because we know it is $U(0,1)$. So, $c \neq 0$ is the case.

Let $F_X(x)$ denote the CDF of $X$. Note that $P(g(X) \leq x) = P(X \leq g^{-1}(x))$, for all $x \in \mathbb R$, which is equal to $F_X(g^{-1}(x))$. So the CDF $F_{g(X)}(x) = F_X(g^{-1}(x)) = F_X(\frac{x-d}{c})$ for some constants $c,d$. But we know what $F_X$ is : for the given situation, it is $\frac{t - a}{b-a}$ if $a < t < b$, $1$ if $t \geq b$ and zero otherwise, while $F_{g(X)}(x)$ is also similarly known as the uniform on $(0,1)$. Fix $x \in (0,1)$. We equate the two CDFs at $x$: $$\frac{\frac{x-d}{c} - a}{b-a} = x \implies xc(b-a) = x-d-ac \implies x(1 - c(b-a)) = d+ac$$

Now, this is true for all $x \in (0,1)$. This, as you can see, can happen if and only if $1-c(b-a) = 0$ (otherwise, you will take it into the denominator on the other side and get a fixed number is equal to every $x$ between $0$ and $1$), and therefore $d+ac = 0$. Simplifying gives you $c = \frac 1{b-a}$ and $d = \frac{-a}{b-a}$. Hence, $g(x) = \frac{x-a}{b-a}$!

Let us now try out this $g$. Indeed, $P(\frac{X-a}{b-a} \leq y) = P(X \leq (b-a)y + a) = F_X((b-a)y + a) = y$, for all $y \in (0,1)$.

Therefore, $g(X) = \frac{x-a}{b-a}$ does the job.

Careful thing to note in the proof : how to go from one PDF to another required as a key point, knowledge of the facts that $g$ had an inverse, as well as how its inverse looked like.

In particular, if $g$ were not given to be linear, this problem may have been much harder.

• I genuinely hope that you will be able to tackle similar questions in the future with the help of this answer. Thank you for accepting. – астон вілла олоф мэллбэрг Mar 28 '18 at 3:11