# PDF (probability density function)

1. Jan 11, 2010

### NotStine

Hi everyone,

I have a simple question (assuming since it was only worth 5% of total marks in the exam) about the PDF of a random variable.

Given that PDF of random signal equals p(X) = $$\Lambda$$(X), where $$\Lambda$$ is the triangle function, what would be the PDF of the random signal Y, Y = -3X + 2.

That was the question given, and I've given it a lot of thought but I cannot come up with any way to solve it.

What I did in the exam was:

p(Y) = $$\Lambda$$(Y) = $$\Lambda$$(-3X + 2) but this looks sooo wrong. Basically I have no idea what I'm doing on this question.

Can somebody kindly guide me, preferrably by presenting all the steps so that I can understand and apply to future problems.

Thank you very much for your time and consideration.

2. Jan 11, 2010

### vela

Staff Emeritus
Use $p(y)dy = p(x)dx$. You have to be careful with the signs though.

Alternatively, you could try to find $F(y)=P(Y\le y)$ using what you know about the definition of Y in terms of X and X's distribution. Then differentiate it to get the probability density function.

Last edited: Jan 11, 2010
3. Jan 12, 2010

### NotStine

I'm sorry I still do not understand what to do. My lecturer was not very thorough when he explained random signals and processes.

From my limited understanding:

$p(x)dx =$$$\Lambda$$$(X)dx = (1-$$$\left|x\right|$$$)dx = -1$

I'm sorry I just do not understand. I do not like to give up this easily but this time I'm completely and utterly lost. I would appreciate it if you could guide me through the process step by step.

Thank you.

4. Jan 12, 2010

### vela

Staff Emeritus
The triangle distribution tells you that $-1\le X\le1$, which means that $-1\le Y\le5$. Now, suppose you wanted to find $P(Y\le 0)$. The range of $Y$ values, $[-1,0]$, corresponds to some range of $X$ values, namely $[2/3,1]$, and the probability that $Y$ is in $[-1,0]$ is equal to the probability that $X$ is in $[2/3,1]$, which you can calculate from $p_X(x)$. So the idea is to find the distribution function $F_Y(y) = P(Y\le y)$ by generalizing this method. Once you have that, you can differentiate it to find $p_Y(y)$.

5. Jan 12, 2010

### NotStine

I understand what you're saying but having functions inside brackets and trying to diffrentiate triangle functions is making me go crazy. I keep on backtracking...

I have something like this:

$F_Y(y) = P(Y\le y) = -3\Lambda(X) + 2$

So then I diffrentiate with respect to y or x? And what is the diffrential of the triangle function?

Thank you for virtually "babysitting" me through this problem and having patience with me.

6. Jan 12, 2010

### vela

Staff Emeritus
Your questions indicate you don't have the basic definitions down yet, and until you get those straight, you're not going to really understand the mathematics. First off, you should know what the probability density function $p_X(x)$ and the distribution function $F_X(x)$ represent and how they are related. Also, note that neither is a function of the random variable $X$, but of some real number $x$; in other words, it's not $F(X)$, but rather $F(x)$, for example.

Then start with this. Forget that $X$ and $Y$ are random variables for a moment, and answer this question: If $Y\le a$ for some real number $a$, what does this tell you about $X$, knowing that $Y=-3X+2$?

7. Jan 13, 2010

### NotStine

$-3X+2\le a$

$X\ge (2-a)/3$

8. Jan 13, 2010

### vela

Staff Emeritus
Great! So $F_Y(a)=P(Y\le a)$ is equal to $P(X \ge (2-a)/3)$, which is given by

$$P(X \ge \frac{2-a}{3}) = \int_{\frac{2-a}{3}}^\infty p_X(x) dx$$

Can you calculate that?

9. Jan 13, 2010

### NotStine

Just when I was feeling some relief, I have to integrate a triangle function...

$$\int_{\frac{2-a}{3}}^\infty p_X(x) dx = \int_{\frac{2-a}{3}}^\infty \Lambda(x) dx = \int_{\frac{2-a}{3}}^\infty 1 - x dx$$

So then I end up with...

$$\left[x - x^2/2\right]_{\frac{2-a}{3}}^\infty$$

And then I get stuck. Have I got the right equation for the triangle function.

PS: I'm really sorry for taking so much of your time vela, and I really appreciate you walking me through this step by step. I wish you were my tutor :D

10. Jan 13, 2010

### vela

Staff Emeritus
Almost. You forgot the absolute value, and it only has the form $1-|x|$ for $-1\le x\le 1$. It's zero elsewhere. The absolute value makes it kind of a pain to integrate, but what you end up with is

$$\int_{\frac{2-a}{3}}^\infty p_X(x) dx = \int_{\frac{2-a}{3}}^\infty \Lambda(x) dx = \left\{ \begin{array}{ll} 0 & \mbox{if  1 \le \frac{2-a}{3} } \\ \int_{\frac{2-a}{3}}^1 (1-x) dx & \mbox{if  0 \le \frac{2-a}{3} < 1 } \\ \int_{\frac{2-a}{3}}^0 (1+x) dx + \int_0^1 (1-x) dx & \mbox{if  -1 \le \frac{2-a}{3} < 0 } \\ 1 & \mbox{if  \frac{2-a}{3} < -1 } \end{array}\right.$$

Don't be sorry. Almost everyone struggles with this stuff the first time they see it.

Last edited: Jan 13, 2010
11. Jan 14, 2010

### NotStine

Thank you. This is what I get for the integration:

$$\int_{\frac{2-a}{3}}^1} 1-x dx = \left[x - \frac{x^2}{2}\right]_{\frac{2-a}{3}}^1} = \frac{a^2 +2a + 1}{18}$$

$$\int_{\frac{2-a}{3}}^0} 1+x dx = \left[x + \frac{x^2}{2}\right]_{\frac{2-a}{3}}^1} = \frac{-a^2 +10a - 16}{18}$$

And for the diffrentiation:

$$p_Y(y) = \left\{ \begin{array}{ll} 0 & \mbox{if  1 \le \frac{2-a}{3} } \\ \frac{1 + a}{9} & \mbox{if  0 \le \frac{2-a}{3} < 1 } \\ \frac{5 - a}{9} & \mbox{if  -1 \le \frac{2-a}{3} < 0 } \\ 0 & \mbox{if  \frac{2-a}{3} < -1 } \end{array}\right.$$

Is this the answer? Thank you once again.

12. Jan 14, 2010

### vela

Staff Emeritus
Close. Note that you have the variable $y$ on the lefthand side but not on the other side. You want to replace all the $a$'s on the righthand side with $y$'s. You might also want to rewrite the inequalities in a simpler form. For example, you can rewrite $1 \le \frac{2-y}{3}$ as $y \le 5$.

So this probably seemed like a lot of work for 5 points, right? If you plot this function, you'll find it's a stretched out triangle distribution. Hopefully, that'll make sense to you given how X and Y are related, and you'll see how by just looking at Y=-3X+2, you could deduce what $p_Y(y)$ should basically look like.

13. Jan 15, 2010

### NotStine

Yes, it is a triangle distribution! Bloody hell!

Thank you so much for guiding me through this problem Vela. I am really really thankful for your tutoring :D

14. Jan 15, 2010

### vela

Staff Emeritus
You're welcome. Glad you figured it out.