# Homework Help: Probability density function

1. Feb 8, 2016

### Schwarzschild90

1. The problem statement, all variables and given/known data

2. Relevant equations
See below

3. The attempt at a solution

\begin{align}
\begin{split}
p(x) = C \ x \ exp(-x/ \lambda)
\end{split}
\end{align}

If $p(x)$ is a probability density function on the interval $0 \textless x \textless + \infty$ , then it follows that the normalization constant can be isolated by setting the area under the curve equal to one

\begin{align}
\begin{split}
\int_0^\infty p(x) \ dx = 1 \to \\ C \int_0^\infty x \ exp(-x/ \lambda) \ dx = 1 \to \\ C \lambda^2 = 1 \to \\ C = \frac{1}{\lambda^2}
\end{split}
\end{align}

\subsection*{(b)}
The mean $\mu$ (or expection $E(X)$) of X is

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty x^2 \ exp(-x/ \lambda) \ dx = 2 \lambda^3
\end{split}
\end{align}

\subsection*{(c)}
Now, determine the standard deviation $\sigma$ of X

\begin{align}
\begin{split}
\sigma =
\end{split}
\end{align}

2. Feb 8, 2016

### haruspex

In 3), did you forget the factor C?
Are you stuck on the standard deviation, or did your post just get truncated?
What formulae do you know related to variance and s.d.?

3. Feb 8, 2016

### Schwarzschild90

I imagined that someone could see if what I had already done was correct

I know the following formula for variance: (E(X^2) - mu^2)

4. Feb 8, 2016

### Ray Vickson

Your computation of $EX$ is incorrect.

Hint: check dimensions. If $X$ happened to be a time, $\lambda$ would have dimensions of time also, and so your $\lambda^3$ would have dimensions of $\text{time}^3$ (but should be just 'time').

5. Feb 8, 2016

### Schwarzschild90

I forgot to divide by λ2.

Now, does 2/λ seem reasonable in your eyes?

6. Feb 8, 2016

### Ray Vickson

Both reasonable and correct, not only in my eyes but absolutely.

7. Feb 8, 2016

### haruspex

Now you seem to have divided by λ4.
If you replace x with λu in the integral you can see you should get a factor λ and an integral independent of λ.
So turn that into an integral. You already have μ.

8. Feb 9, 2016

### Ray Vickson

Sorry: I am so used to looking at such distributions in the form $c t e^{-\lambda t}$ (that is, with $\lambda t$ instead of $t/\lambda$) that my brain failed to process the difference in your case. So, NO: you are still not correct.

9. Feb 9, 2016

### Schwarzschild90

Like this? I don't understand why we replace x with lambda u

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty (\lambda u)^2 \ exp(-(\lambda u)/ \lambda) \ dx =
\end{split}
\end{align}

10. Feb 9, 2016

### haruspex

I was just using that to show that the final expression must be linear in lambda.
$\frac{1}{\lambda^2} \int_0^\infty (\lambda u)^2 \ exp(-(\lambda u)/ \lambda) \ d(\lambda u)=\lambda\int_0^\infty u^2e^{-u}.du$. Your first version ended up with a factor λ3 because you forgot the factor C=λ-2, but then somehow you got λ-1, as though you made the correction twice over.

11. Feb 9, 2016

### Schwarzschild90

So, 2\lambda would be correct?

12. Feb 9, 2016

### haruspex

Yes.

13. Feb 9, 2016

### Schwarzschild90

Will use this formula to calculate the standard deviation
\begin{align}
\begin{split}
\sigma = std(X) =\sqrt{ \int_a^b (x-\mu)^2 \ f(x) \ dx }
\end{split}
\end{align}

14. Feb 9, 2016

### haruspex

Ok, but you might find the form var(X)=E(X2)-E(X)2 more convenient than E((X-E(X))2).

15. Feb 9, 2016

### Schwarzschild90

I assume sqrt(E(X2)-E(X)2)?

16. Feb 9, 2016

### haruspex

For standard deviation, yes. I was quoting formulae for variance (σ2).

17. Feb 9, 2016

### Schwarzschild90

\begin{align}
\begin{split}
E(X^2) = \frac{1}{\lambda^2} \int_0^\infty x^3 \ exp(-x/ \lambda) \ dx = 6 \lambda^2 \\
\mu^2 = 4\lambda^2 \\
\sigma = std(X) = \sqrt{var(X)} = \sqrt{E(X^2) - \mu^2} = \sqrt{6\lambda^2 - 4\lambda^2}= \sqrt{2\lambda^2} = \sqrt{2}\lambda \\
\end{split}
\end{align}

It seems almost impossible to commit a mistake using the above equation :P, but I've been wrong before

Last edited: Feb 9, 2016
18. Feb 9, 2016

Looks right.