# Confusion related to calculating the probability distribution of a variable

I have this confusion related to calculating the probability distribution of a variable. If I have a variable $x_1$ which has a pdf $p(x_1)$.Lets assume that the distribution is gaussian with mean $X_1$. I sample a point from this distribution lets say $X_1'$.

Now I have another random variable $x_2$ which has a distribution $p(x_2)$. Its mean is equal to a constant, $X_2$ plus the previous sample $X_1'$. So how can I write the pdf function for this random variable $x_2$. I mean I want its mean to be dependent upon the sample from the distribution of $x_1$.

• Your choice of notation is dreadful. Most people tend to use upper-case (capital) letters for random variables and lower-case letters for the arguments of density functions, real variables, etc. Also, is p the same function in the two cases? Mar 31, 2013 at 3:24

If $X$ is a continuous random variable with pdf $f_X(x)$ with mean $\mu_X$, and $Y$ is a random variable whose conditional pdf given that $X = a$ is $f_{Y\mid X=a}(y\mid X=a)$ with mean $\mu_1+a$, that is, $E[Y\mid X=a] = \mu_1+a$, then the random variable $E[Y\mid X] = \mu_1 + X$, and $$E[Y] = E[E[Y\mid X]] = E[\mu_1+X] = \mu_1+\mu_X.$$ The unconditional density of $Y$ is $$f_Y(y) = \int_{-\infty}^\infty f_{Y\mid X=a}(y\mid X=a)f_X(a)\,\mathrm da.$$ If $X$ is a unit-variance Gaussian random variable, and the conditional pdf of $Y$ is also a unit-variance Gaussian density, then $$f_Y(y) = \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{1}{2}(y-\mu_1-a)^2\right) \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{1}{2}(a-\mu_X)^2\right)\,\mathrm da$$ which, after you combine the exponentials, complete the square, etc. will work out to be a Gaussian density with mean $\mu_1+\mu_X$.