# Cumulative distribution (uniform distribution/continuous)

Let $$X$$ be a continuous uniform random variable on the interval $$[0,2]$$.

How to determine the cumulative distribution function of $$Y=X(2-X)$$?

I got:

Since $$X$$ is uniformly distributed, the probability density function is $$f_X(x)=\frac{1}{2}\boldsymbol{1}_{0

Now I tried to find the cumulative distribution function:

$$F_Y(y)=\mathbb{P}(Y \leq x)=\mathbb{P}(X(2-X) \leq x)=\mathbb{P}((2X-X^2) \leq x)$$

How to continue the transformation such that I get $$\mathbb{P}(X \leq …)$$?

I don't see how to rewrite $$2X-X^2$$ here.

Add $$-1$$ to both sides,$$2X-X^2-1=-(X-1)^2\le x-1\implies(X-1)^2\ge1-x$$When $$x\ge1$$, the inequality is always true and the c.d.f. of $$Y$$ is $$1$$. For $$x<1$$,$$P[(X-1)^2\ge1-x]\iff P(|X-1|\ge\sqrt{1-x})\\\iff P(X\le1-\sqrt{1-x})+P(X\ge1+\sqrt{1-x})$$For $$x<0$$, the first and second terms are both $$0$$ (Why?). So you only have to talk about $$x\in[0,1)$$. Can you take this forward?

You actually cannot, because $$x \mapsto x(2-x)$$ is not an injective function on $$[0,2]$$; each point in $$(0,1)$$ has two preimages. Thus you need to write the event $$X(2-X) \leq x$$ as $$X \in I_1 \cup I_2$$ where $$I_1,I_2$$ are appropriately chosen intervals. A graph will help you to do that.

Adding some sketches might help clarify the approach and motivate intuition/solving:

              Y
|            Y=X(2-X)
|Y=1           .  .
|          .           .         pdf(X)
|--------------------------------
|   .                        .
| .
--0----------------1--------------2---- X
|     |                   |
|   X_lower            X_upper
|


Solving $$Y=X(2-X)$$ for X we get: $$X = \frac{2\pm \sqrt{4-4Y}}{2} = 1 \pm \sqrt{1-Y}$$

Since we know that PDF of $$X$$ is $$1/2$$ for $$X$$ in $$[0,2]$$, the CDF is just the constant integral from 0 to X (lower portion) and X to 2 (upper portion) - see figure above for the sketch of Y(x):

CDF of lower portion is $$1/2*(1-\sqrt{1-Y})$$: Negative root is the lower solution for X.
CDF of upper portion is $$1/2*(2-(1+\sqrt{1-Y}))$$: Positive root is the upper solution for X.
Total is the sum = $$1-\sqrt{1-Y}$$
Therefore $$P(Y \le y)=1-\sqrt{1-y}$$

I hope this helps.