# How do I find all even moments (and odd moments) for $f_X(x)=\frac{1}{2}e^{-|x|}$?

I was asked to find a formula for all even moments of the form $$E(X^{2n})$$ and all odd moments of the form $$E(X^{2n+1})$$ using a mgf. Can you help me find the even moments? I will attempt to solve for the odd moments using similar techniques.

Let $$X$$ be a continuous random variable having the density $$f_X(x)=\frac{1}{2}e^{-|x|}$$, where $$-\infty < x < \infty$$.

My work: I was able to obtain the following moment-generating function: $$M_X(t)=(1-t^2)^{-1}.$$ However, I am unsure of where to go from here. Thank you for your help.

• Hint: If you can express $M_X(t)$ as a power series in $t$, (that is, something that looks like $1 + m_1t + m_2t^2 + m_3 t^3 + \cdots$) then you can find $E[X^n]$ in terms of $m_n$ Commented Sep 16, 2019 at 22:02
• I think I see what you're saying. Since $M_X(t)=(1-t^2)^{-1}$, then it slightly resembles a geometric series: $(1-t^2)^{-1}=1+t^2+(t^2)^2+(t^2^)3+ \cdots$. This can only happen if $|t^2| <1,$ which is satisfied Commented Sep 16, 2019 at 22:11
• About odd moments : have you plotted the distribution ? What would be the mean ? the skew ? can you infer something about odd moments for symetrical distributions ? Commented Sep 16, 2019 at 22:26
• I plotted the distribution. The mean appears to be 0, and the plot is symmetrical. I found this link that infers that odd moments of symmetrical distributions are 0. How could I show this result using mgfs? math.stackexchange.com/questions/72451/… Commented Sep 16, 2019 at 23:15
• It does not contain the explanation what you are supposed to do with the moment generating function in order to obtain the moments? Commented Sep 17, 2019 at 0:38

One way to make your mgf approach to the problem easier is to use the power series

$$(1-t^2)^{-1}=\sum_{j=0}^{\infty} t^{2j}$$

Differentiating the rhs repeatedly is much easier than differentiating the lhs. (note this only applies for $$|t|<1$$ but as you are differentiating at $$t=0$$ it still works). You should see that it will just be a factorial. However is it probably even simpler to just evaluate the expectation directly

$$E(X^{2n})=\int_{-\infty}^{\infty}\frac{x^{2n}}{2}\exp(-|x|)dx$$

The result should be a gamma function (ie factorial). This also becomes clear from the mgf power series.

update regarding the mgf approach, to evaluate $$E(X^{2n})$$ we need to differentiate the rhs $$2n$$ times. The following result will be useful

$$\frac{\partial^k x^{r}}{\partial x^k} =\left( \begin{matrix} \frac{r!}{(r-k)!}x^{r-k} & r=k,k+1,\dots \\ 0 & r=1,\dots,k-1 \end{matrix} \right)$$

Now if you apply this to the term $$t^{2j}$$ and take the "2n-th" derivative, we have $$r=2j$$ and $$k=2n$$ and $$x=t$$. Then we get $$\frac{\partial^{2n} t^{2j}}{\partial t^{2n}} =\left( \begin{matrix} \frac{(2j)!}{(2j-2n)!}t^{2j-2n} & 2j=2n,2n+2,2n+4,2n+6,\dots \\ 0 & 2j=0,2,\dots,2n-2 \end{matrix} \right)$$

This means when we add up over all the terms we can write this as $$\sum_{j=0}^{\infty}\frac{\partial^{2n} t^{2j}}{\partial t^{2n}}=0+\dots+0+(2n)!+t^2\frac{(2n+2)!}{2!}+t^4\frac{(2n+4)!}{4!}+\dots$$

only the single tertm $$(2n)!$$ is not $$0$$ and also not a multiple of $$t$$. So setting $$t=0$$ leaves only that term.

• Thank you for providing both ways to solve this problem. I think I would use the latter approach if I am given a choice- it seems more direct. Commented Sep 17, 2019 at 3:12
• My second derivative of the rhs is $\Sigma^\infty _{j=0}[2j(2j-1)t^{2j-2}]$, but when this is evaluated at $t=0$, it is equal to zero. Where am I messing up? Commented Sep 17, 2019 at 3:16
• There will always be a term that has a zero power, so that when $t=0$ you will get $t^0 = 0^0 = 1$, and the result will be the coefficient for that power.
– Ben
Commented Sep 17, 2019 at 5:22
• The updates to this post are very much appreciated. Thank you for the explanation. Commented Sep 18, 2019 at 5:01

Hint: This is an example of a probability density function that is symmetric about zero:

$$f_X(0+x) = f_X(0-x) \quad \quad \quad \text{for all } x \in \mathbb{R}.$$

Visually, this means that the distribution is reflected around the zero line, and is the same on both sides. See if you can use this property to figure out (and then prove) what the odd moments would be. The even moments are a bit trickier, but see if you can use this property to reduce those moments to a simpler form.

• Thank you for this hint. I see how odd moments would equal 0 around a symmetric distribution, but how can I obtain this result from my MGF? Commented Sep 16, 2019 at 23:17
• I think the best method is to expand it out as a power series, as shown in the excellent answer by probabilityislogic.
– Ben
Commented Sep 17, 2019 at 5:42

If you don't care to do unnecessary calculation, it is convenient to view your distribution as an equal mixture of an Exponential and its negative:

$$\frac{1}{2} e^{-|x|} = \frac{1}{2} e^{-x}\,\mathcal{I}(x\gt 0) + \frac{1}{2} e^{x}\,\mathcal{I}(x \lt 0).$$

Because $$((-1)^n + (1)^n)/2$$ is either $$-1+1=0$$ or $$(1+1)/2 = 2/2 = 1$$ as $$n$$ is odd or even, respectively, the odd moments of your distribution are zero and the even moments are the same as those of the Exponential. But, by definition, the even Exponential moments are

$$\mu_{2k} = \int_0^\infty x^{2k} e^{-x}\mathrm{d}x = \Gamma(2k+1) = (2k)!$$

Because this required no calculation more difficult than $$1+1=2,$$ it's hard to imagine a simpler solution.

If instead you wish to pursue the moment generating approach, begin by noting that the mgf of the Exponential distribution is $$\phi(t)=\int_0^\infty e^{tx} e^{-x}\mathrm{d}x = \int_0^\infty e^{-(1-t)x}\mathrm{d}x = \frac{1}{1-t}.$$ Thus the mgf of this mixture is

$$(\phi(t) + \phi(-t))/2 = \frac{1}{2}\left(\frac{1}{1-t} + \frac{1}{1-(-t)}\right) = \frac{1}{1-t^2}.$$

This is analytic near $$0$$ and therefore equals the power series expansion given by the Binomial Theorem as

$$\frac{1}{1-t^2} = (1 + (-t^2))^{-1} = \sum_{k=0}^\infty \binom{-1}{k} (-t^2)^k = \sum_{k=0}^\infty t^{2k} = \sum_{k=0}^\infty \color{red}{(2k)!}\, \color{gray}{\frac{t^{2k}}{(2k)!}},$$

from which you may read off the moments as the coefficients of $$t^n/n!:$$ again we see they are zero for the odd moments and $$(2k)!$$ for the even moments.

• Thank you for sharing both the simplest way and the mgf way. Commented Sep 18, 2019 at 5:03

Since the OP seems to be having difficulty with the various hints in the comments and the other answers, here is a heuristic method that yields the right answer in this instance. \begin{align} E[\exp(tX)] &= E\left[1 + tX + \frac{(tX)^2}{2!} + \frac{(tX)^3}{3!} + \cdots\right]\\ &= 1 + tE[X] + \frac{t^2}{2!}E[X^2] + \frac{t^3}{3!}E[X^3] + \cdots\tag{1}\\ \end{align} and so if we have a power series for $$E[\exp(tX)] = M_X(t)$$ that we have managed to find by hook or by crook and without looking at the displayed equation above since that will just serve to confuse us, then we can just look at the coefficient of $$t^n$$ in the power series that we have and say "Hey Ma! I think that the coefficient of $$t^n$$ is just $$\frac{1}{n!}E[X^n]$$ and so I can find $$E[X^n]$$ by multiplying the coefficient that I already have by $$n!$$.

For the OP's specific case, he has already found that $$M_X(t) = \frac{1}{1-t^2} = 1 + t^2 + t^4 + \cdots + t^{2n} + \cdots \tag{2}$$ (that's the "by hook or by crook" part) and so he can compare $$(1)$$ and $$(2)$$ to figure out what the moments are. I will leave it to the OP to tell Ma that $$E[X^n]=0$$ whenever $$n$$ is odd. Whether he wishes to tell Ma what $$E[X^n]$$ is for even $$n$$ is a matter for him to decide. The $$E[X^4]=12$$ that the OP claims (in a comment) to have calculated doesn't sound right to me (I think it should be $$E[X^4] = 4! = 24$$), but who am I to interfere in the sacred relationship between mother and child?

• Thank you for your entertaining input. I see what you are saying. So I am getting that $E[X^n]=n!$, since we multiple $n!$ by the coefficient of each $t^n$, where $n$ is even. Now I get how you expanded both $E[e^{tX}]$ and $M_X(t)$, but how can you use the coefficients of the two expansions with each other? I would like to understand the big picture. Commented Sep 17, 2019 at 3:04

So I calculated the first, second, third, and fourth derivatives. I got $$E(X^1)=0$$, $$E(X^2)=2$$, $$E(X^3)=0$$, and $$E(X^4)=12$$. These derivatives are quite long to compute at this point, so I m wondering if there is an easier way to go about this to obtain a formula for the evens.

You could use the Taylor series expansion:

$$\frac{1}{1-t^2} = \sum_{k=0}^\infty t^{2k}$$

However, this is a bit of a circular reasoning since the Taylor series expansion is itself derived by computing the derivatives. In that case you can just as well look up directly a formula for the higher order moments of the Laplace distribution.

You might find that Taylor series expansion indirectly - not using $$f(x) = \sum_{n=0}^\infty f^{(n)}/n! t^k$$ - by instead using the formula for a geometric series.

However, you could also 'manually' derive the derivatives (that means straight forward computation using chain rule and product rule) and when you look at the pattern of the terms then you will find that many of the terms become zero and a regular pattern emerges.

Say we substitute $$u = t^2$$ then the derivation it looks simpler:

$$\frac{\text{d}^n}{\text{d}u^n} \frac{1}{(1-u)} = \frac{n!}{(1-u)^n}$$

Now use Faà di Bruno's formula (chain rule but then applied several times):

$$\frac{\text{d}^n}{\text{d}t^n} \frac{1}{(1-u)} = \sum_{k=1}^n \frac{k!}{(1-u)^k} \cdot B_{n,k}(2t,2,0,...,0)$$

where $$B_{n,k}$$ refers to Bell polynomials. Most of the terms will be zero and you get

$$\frac{\text{d}^{2n}}{\text{d}t^{2n}} \frac{1}{(1-t^2)} = \sum_{k=0}^n c_{nk} \frac{t^{2k}}{(1-t^2)^{1+n+k}}$$

with

$$c_{nk} = 2^{2k} \frac{(2n)! \cdot (n+k)!}{(n-k)! \cdot (2k)!}$$

and for the value at $$t=0$$ you have

$$\frac{\text{d}^{2n}}{\text{d}t^{2n}} \frac{1}{(1-t^2)} = c_{n0} = (2n)!$$

• Although I am not familiar with Faa di Bruno's formula, I like the structure of your answer. Thank you for your addition! Commented Sep 18, 2019 at 5:04
• When you differentiate one time you get $2t\cdot\frac{1}{(1-t^2)}$ two times $2\cdot\frac{1}{(1-t^2)^2} + 2t\cdot4t\cdot\frac{1}{(1-t^2)^3}$ and so on. It is combinations of higher order derivatives of $f(u)=1/(1-u)$ and $g(t)$ that appear due to repeatedly differentiating (applying chain and product rules creating those multiple terms). Faa di Bruno's formula keeps track of those terms. In this case because the derivatives of $t^2$ terminate at some point it becomes relatively easy to keep track of the terms. Of course other ways to derive the series are easier but this one is also cool. Commented Sep 18, 2019 at 7:13
• This is a really interesting result. Thank you for sharing it. Commented Sep 19, 2019 at 3:32
• It is actually a cumbersome way to compute $!n( (1-t)^{-n} - (-1-t)^{-n})$ Commented Sep 19, 2019 at 6:47