# What is the correct way of compute PDF of $Y=2X$

Let $$X$$ be a random variable and $$X\sim U(0,1)$$. Define a new random variable $$Y=2X$$, What is the PDF of $$Y$$, $$f_Y(y)$$?

If $$f_Y(y)$$ is calculated as the convolution of the PDF of $$X$$, $$f_X(x)$$ with itself:

$$f_Y(y)=(f_X*f_X)(y)=\int_{-\infty}^{\infty}f_X(x)f_X(y-x)dx$$

$$f_Y(y)= \begin{cases} 0,& y\in\Bbb R/[0,2]\\ y,& 0\leq y <1\\ -y+2,& 1\leq y \leq 2 \end{cases}$$

If $$f_Y(y)$$ is calculated by the formula:

$$f_Y(y)=f_X(y){dx\over dy}$$

$$f_Y(y)= \begin{cases} 0,& y\in\Bbb R/[0,2]\\ 1/2,& y\in[0,2] \end{cases}$$

meaning that $$Y\sim U(0,2)$$. In both cases, $$\Bbb E[Y]=1$$ and $$\int_{(-\infty,\infty)}f_Y(y)dy=1$$. Which one is true?

• Convolution is not proper usage here. X is not independent from itself. Commented Apr 22, 2023 at 21:34
• @ncmathsadist thanks Commented Apr 22, 2023 at 22:11

Sadly, the notation commonly used for random variables is trash, and it leads to confusion like this. Because "$$X+X$$" and "$$2X$$" indicate two separate things!

$$X+X$$ indicates two independent variables, both with the same distribution as $$X$$, and models taking a sample from each of them and adding them together. This is what your first calculation models, and results in a convolution.

(One usually sees the more correct $$X_1+X_2$$, along with a comment that "The $$X_i$$ are i.i.d. (="independent identically distributed")," Honestly, one should never write "$$X+X$$", but it does model the confusion we see, and I've seen it being used in questions based on the same confusion your having.)

In contrast, $$2X$$ is used to model sampling $$X$$ (once), and then doubling that result. And this leads, correctly, to your second distribution. I'm not familiar with the formula you cite, but it looks like it should follow easily from writing out the integrals in your case.

[By the way, I've seen this confusion multiple times, and you (and I) are about to be besieged by people saying that there is no way one should be confused, and that random variables are just real valued functions on sample spaces, so of course $$X+X$$ and $$2X$$ are the same, but they are ignoring the dependence vs. independence question implicit in writing $$X+X$$.]

• After testing independence for two random variables with the same distribution that can be indepedent, I understood that both cases are distint. Thanks you. Commented Apr 22, 2023 at 22:11
• Not sure of the context of your comment, but I think you're saying that your situation corresponded to $X_1 + X_2$, and not $2X$? Either way, glad it sounds like this cleared things up for you. Commented Apr 22, 2023 at 22:14
• Nop, I was testing the theory because I'm trying to do a theory about Quantile functions and its relation with function of random variables. Commented Apr 22, 2023 at 22:16