# Moment generating function question

#### oyth94

##### Member
Let X1,X2,…,Xn be independent random variables that all have the same distribution, let N be an independent non-negative integer valued random variable, and let SN:=X1+X2+⋯+XN. Find an expression for the moment generating function of SN

so all i know is that it is i.i.d but i am not sure what distribution it is in order to find the moment generating function. how do i solve this question?

#### chisigma

##### Well-known member
Re: moment generating function question

Let X1,X2,…,Xn be independent random variables that all have the same distribution, let N be an independent non-negative integer valued random variable, and let SN:=X1+X2+⋯+XN. Find an expression for the moment generating function of SN

so all i know is that it is i.i.d but i am not sure what distribution it is in order to find the moment generating function. how do i solve this question?
I'm not sure to have correctly understood... is N, the number of random variables, a random variable itself?...

Kind regards

$\chi$ $\sigma$

#### chisigma

##### Well-known member
Re: moment generating function question

Let X1,X2,…,Xn be independent random variables that all have the same distribution, let N be an independent non-negative integer valued random variable, and let SN:=X1+X2+⋯+XN. Find an expression for the moment generating function of SN

so all i know is that it is i.i.d but i am not sure what distribution it is in order to find the moment generating function. how do i solve this question?
Let suppose that we know the quantity...

$\displaystyle p_{n}= P \{N=n\}\ (1)$

... and each continous r.v. is $\displaystyle \mathcal {N} (0,\sigma)$, then is...

$\displaystyle m_{S_{N}} (t) = \sum_{n=1}^{\infty} p_{n}\ e^{\frac{n}{2}\ \sigma^{2}\ t^{2}}\ (2)$

Kind regards

$\chi$ $\sigma$

#### oyth94

##### Member
Re: moment generating function question

Let suppose that we know the quantity...

$\displaystyle p_{n}= P \{N=n\}\ (1)$

... and each continous r.v. is $\displaystyle \mathcal {N} (0,\sigma)$, then is...

$\displaystyle m_{S_{N}} (t) = \sum_{n=1}^{\infty} p_{n}\ e^{\frac{n}{2}\ \sigma^{2}\ t^{2}}\ (2)$

Kind regards

$\chi$ $\sigma$
I'm not sure how you arrived at this answer..can you please explain?

#### chisigma

##### Well-known member
If I understood correctly, the $X_{i}, i=1,2,...,N$ are continous r.v. with the same p.d.f. f(x) [which is not specified...] and N is a discrete r.v. with discrete p.d.f. $p_{n} = P \{N=n\}, n=1,2,...\$. Setting $S = X_{1} + X_{2} + ... + X_{N}$, the r.v. S has p.d.f. ...

$\displaystyle f_{N} (x) = f(x) * f(x) * ... * f(x),\text{N times}\ (1)$

... and the moment generating function is...

$\displaystyle m_{S} (t) = E \{e^{S\ t}\} = \sum_{n=1}^{\infty} p_{n}\ \int_{- \infty}^{+ \infty} e^{x\ t} f_{n} (x)\ dx\ (2)$

Kind regards

$\chi$ $\sigma$