# Finding the PDF of Y=X-2 [closed]

I am given the following PDF of random variable $X$:

$$f(x)= \begin{cases} e^x & \text{for }x<0, \\ 0 & \text{otherwise}. \end{cases}$$

a) Compute $E(e^x)$:

Here is my work:

$$E(e^x)=\int_{-\infty}^0 xe^x dx = -1$$

b) Find PDF of $Y=X-2$:

I am really stuck on how to do this part

## closed as off-topic by Did, Edward Jiang, Daniel W. Farlow, Leucippus, k170Apr 27 '16 at 1:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Did, Edward Jiang, Daniel W. Farlow, Leucippus, k170
If this question can be reworded to fit the rules in the help center, please edit the question.

• Look here under "Dependent variables and change of variables": en.m.wikipedia.org/wiki/Probability_density_function – Theodor Johnson Apr 26 '16 at 18:34
• How do you pass from f(x)=e^(x) for x<0 f(x)=0 otherwise to E(e^(x))=\int_{-inf}^0 xe^(x) dx? – Did Apr 26 '16 at 18:35
• E(e^(x)) = integral from negative infinity to 0 of [xe^(x)]dx = e^(x)(x-1) evaluate from negative infinity to 0 = (1)(-1)-(0) = -1 – Lcheck Apr 26 '16 at 19:56

## 2 Answers

a) There is a formula $$E[g(X)] = \int_S g(x)f_X(x)\,dx$$ where $S$ is the support of a random variable $X$, and $g(X)$ is a function of that random variable. It looks like you want to compute $$E[e^X] = \int_{-\infty}^0 e^xf_X(x)\,dx = \int_{-\infty}^0 e^x\cdot e^x\,dx.$$

b) The popular method is to compute $$P(Y\leq y) = P(X-2\leq y) = P(X\leq y+2)$$ to find the CDF of $Y$.

• For part A I got (1/2), does that sound correct? Also for part B I am not sure where to go from there – Lcheck Apr 26 '16 at 20:00
• Do you know what $P(X\leq x)$ means? This isn't much different. – Em. Apr 26 '16 at 21:11
• I know I've seen it before, I understand the similarity. But I'm not sure what that means I need to calculate – Lcheck Apr 26 '16 at 23:42
• Loosely speaking, it means the area under the curve up to $x$. In our case, we have $P(X\leq x) = \int_{-\infty}^x f_X(t)\,dt$ for $x\leq 0$. – Em. Apr 26 '16 at 23:56
• Okay, so I would need to take the integral from negative infinity to (x-2) and that would give me the CDF, correct? And from there how do I get to the PDF? – Lcheck Apr 27 '16 at 0:55

In general when you are looking for the pdf of a random variable of the kind

$Y = aX + b$

where $a$ and $b$ are real constants you use the standard transformation of variables formula with $x = g^{-1}(y) = h(y)$

$$f_Y(y) = f_X(x)\left|\frac{dx}{dy}\right| = f_X[h(y)]\left|\frac{dh(y)}{dy}\right|$$

Applying this to $Y = aX + b$ you get

$$f_Y(y) = \frac{1}{|a|}f_X \left( \frac{y-b}{a} \right)$$