# Thread: Differentiating a cumulative distribution function

1. ## Differentiating a cumulative distribution function

Obviously I'm stuck. The question is to find the density function, Y = 2X.

Fy(a) = Pr{Y<=a}
= Pr{2X<=a}
= Pr{X<=a/2}
= Fx(a/2)

Differentiate both Fy and Fx cdfs

fy(a) = 1/2fx(a/2)

I don't understand where the 1/2 comes from. Differentiating a cdf like F(a) results in the density function f(a), so wouldn't differentiating Fx(a/2) produce fx(a/2)?

2. Originally Posted by notgoodatmath
Obviously I'm stuck. The question is to find the density function, Y = 2X.

Fy(a) = Pr{Y<=a}
= Pr{2X<=a}
= Pr{X<=a/2}
= Fx(a/2)

Differentiate both Fy and Fx cdfs

fy(a) = 1/2fx(a/2)

I don't understand where the 1/2 comes from. Differentiating a cdf like F(a) results in the density function f(a), so wouldn't differentiating Fx(a/2) produce fx(a/2)?
Use the chain rule. Let u = a/2.

Then $\frac{dF_x(a/2)}{da} = \frac{dF_x(u)}{du} \cdot \frac{du}{da} = f_x(u) \cdot \frac{1}{2} = f_x(a/2) \cdot \frac{1}{2}$.

3. Thanks! I got it now.

I'm also looking for the distribution function of Y with Y=e $^x$

F_y(x) = P{Y<=x}
= P{e $^x$ <= x}
= P{X <= log(x)}
= $\int^{log(x)}_0$f(y)d(y)
= log(x)

I'm getting stuck at the integral stage. Could you explain how to get from the integral to the answer of log(x)? Isn't it just f(log(x))-0 = f(log(x))?

4. Originally Posted by notgoodatmath
Thanks! I got it now.

I'm also looking for the distribution function of Y with Y=e $^x$

F_y(x) = P{Y<=x} Mr F says: This notation is poor. You should use notation like F(y) = Pr(Y < y) = Pr(e^X < y) ....

= P{e $^x$ <= x}
= P{X <= log(x)}
= $\int^{log(x)}_0$f(y)d(y)
= log(x)

I'm getting stuck at the integral stage. Could you explain how to get from the integral to the answer of log(x)? Isn't it just f(log(x))-0 = f(log(x))?
You need to say what distribution X follows before any integration can be done to get the cdf for Y.

5. Ok. I have a density function for X: f(x) = $\{^{1 if 0 \le x \le 1}_{0 otherwise}$. The question asks me to find E[e $^x$].

To simplify, Y = e $^x$. To determine Fy (cdf of Y), for $1 \le x \le e$

Fy = Pr(Y $\le$ x)

= Pr(e $^x \le log(x)$)

= Pr( $X \le log(x)$)

= $\int^{log(x)}_0$f(y)dy **My query is at this stage**

= log(x)

Then, differentiate Fy so that fy = $\frac{1}{x}$(when $1 \le x \le e$)

After a bit more integration the answer comes to e - 1. I don't get how the integral marked with an asterisk is calculated though.

6. Originally Posted by notgoodatmath
Ok. I have a density function for X: f(x) = $\{^{1 if 0 \le x \le 1}_{0 otherwise}$. The question asks me to find E[e $^x$].

To simplify, Y = e $^x$. To determine Fy (cdf of Y), for $1 \le x \le e$

Fy = Pr(Y $\le$ x)

= Pr(e $^x \le log(x)$)

= Pr( $X \le log(x)$)

= $\int^{log(x)}_0$f(y)dy **My query is at this stage**

= log(x)

Then, differentiate Fy so that fy = $\frac{1}{x}$(when $1 \le x \le e$)

After a bit more integration the answer comes to e - 1. I don't get how the integral marked with an asterisk is calculated though.
I see you didn't take my advice regarding notation - thta's probably part of your trouble.

$F(y) = \Pr(Y \leq y) = \Pr(e^X \leq y) = \Pr(X \leq \ln y) = \int_{0}^{\ln y} 1 \, dx = [x]_{0}^{\ln y} = \ln y$ for $1 \leq y \leq e$.

(Note that $0 \leq X \leq 1 \Rightarrow 1 \leq Y = e^X \leq e$).

Then the pdf for Y is $f(y) = \frac{dF}{dy} = \frac{1}{y}$ for $1 \leq y \leq e$ and zero elsewhere.

Then $E(e^X) = E(Y) = \int_1^e y \, \left(\frac{1}{y}\right) \, dy = e - 1$.

-----------------------------------------------------------------------------

But why do all this when you can just use $E[g(X)] = \int_{-\infty}^{+\infty} g(x) \, f(x) \, dx$ where f(x) is the pdf of X ......!?

In your case $E(e^X) = \int_0^1 e^x (1) \, dx = e - 1$. Much less effort!

7. Originally Posted by mr fantastic
I see you didn't take my advice regarding notation - thta's probably part of your trouble.

$F(y) = \Pr(Y \leq y) = \Pr(e^X \leq y) = \Pr(X \leq \ln y) = \int_{0}^{\ln y} 1 \, dx = [x]_{0}^{\ln y} = \ln y$ for $1 \leq y \leq e$.

(Note that $0 \leq X \leq 1 \Rightarrow 1 \leq Y = e^X \leq e$).

Then the pdf for Y is $f(y) = \frac{dF}{dy} = \frac{1}{y}$ for $1 \leq y \leq e$ and zero elsewhere.

Then $E(e^X) = E(Y) = \int_1^e y \, \left(\frac{1}{y}\right) \, dy = e - 1$.

-----------------------------------------------------------------------------

But why do all this when you can just use $E[g(X)] = \int_{-\infty}^{+\infty} g(x) \, f(x) \, dx$ where f(x) is the pdf of X ......!?

In your case $E(e^X) = \int_0^1 e^x (1) \, dx = e - 1$. Much less effort!
Perfect. That's just what I wanted. Thanks!

I was just trying to understand the derivation. The notation that I used was as in the probability book I'm using - perhaps I should dump it? I just copied out the notation there in case I made a mistake. But I agree, it's simpler the way you put it there. cheers!