<s>[INST] Random variable transformation function I am stuck with a random variable transformation problem ($Y=\phi(X)$). The random variable $X$ has a uniform distribution $U(-1,1)$, and I want to transform it into $Y$ which is also an uniform distribution $U(\frac{s}{2},2s)$, where $s$ is some scalar quantity. Does anyone know a transformation function $\phi$ which transforms $X$ into $Y$ with these constraints? 
Presently, I am using the function $Y=s2^X$, which unfortunately gives me an exponential distribution of $Y$ and not uniform distribution. Thank you in advance
 [/INST] $2s-\frac{s}{2}= \frac{3s}{2} = \frac{3s}{4} \times (1-(-1))$
$\frac{3s}{4} \times 1 = \frac{3s}{4} = 2s - \frac{5s}{4}$ and $\frac{3s}{4} \times (-1) = -\frac{3s}{4} = \frac{s}{2} - \frac{5s}{4}$
So $Y=\frac{3s}{4}  X +\frac{5s}{4} = \frac{s}{4} (3x+5) $ is a possible answer.
$Y=-\frac{3s}{4}  X +\frac{5s}{4} = \frac{s}{4} (5-3x) $ is another and there are many more non-linear possibilities, though they will be more complicated.
</s>