# Conceptual question on random variables with the same cdf

Given a continuous random variable $X$ let $Z = F_X(X)$, where $F_X(s) = P(X \leq s)$. Then $P(Z \leq z) = z$ and we say that $Z$ is uniformly distributed.

Say we have another continuous random variable $Y$, which has a different distribution than $X$. Let $G = F_Y(Y)$ where $F_Y(s) = P(Y \leq s)$. $G$ is then also uniformly distributed.

Does this mean that $G$ and $Z$ have the same CDF? (I feel like I'm missing something super basic, haha). I'm asking this because my textbook says that if two random variables have the same CDF, then they have the same PDF, and I don't see how that could reconcile with the above.

• $G$ and $Z$ do have the same CDF and the same PDF. The PDF has value $1$ on $(0,1)$ and is zero otherwise. One would write $G, Z \sim U(0,1)$. It is $X$ and $Y$ that have different CDFs and PDFs; not $G$ and $Z$, and there is no contradiction in any of this. Jan 12, 2016 at 18:41

What your textbook says is actually not entirely true. If two random variables have the same cumulative distribution function, then their density functions are equal almost everywhere. For instance, a perfectly valid density function for a random variable uniformly distributed over the open interval $(0, 1)$ is a function which equals one over $(0, 1)$ and zero otherwise. Or we could just as easily define the density to equal one at the endpoints if we wanted. Being even more extreme we could have it take on completely arbitrary values on any countable subset of $\mathbb{R}$, the only requirement is that the density functions need to integrate to the same value over sets of the form $(-\infty, a]$. If this is the case then it's clear we'll arrive at the same distribution function.