# Verifying correct way of using moment generating functions to find cdf

I just wanted to make sure my understanding of using pmf from moment generating functions is correct here. I want to calculate $P(1\leq X \leq 2)$ with the moment generating functions:

A) $M(t)=(0.3+0.7e^t)^5$

B) $M(t)= \frac{0.3e^t}{1-0.7e^t}$

For A) I know its a binomial distribution, which means that its pmf would be $f(x)=\binom{n}{x}p^x(1-p)^{n-x}$. I think I would take the difference of $P(X\leq 2)-P(x\leq 1)$, would be be the summation of $n=0$ to $2$ subtract that of $0$ to $1$ of the pdf, $f(x)$.

for B) I know this is a geometric distribution, which means its pmf would be $f(x)= (1-p)^{x-1} p$. I would also take the difference of $P(X\leq2)-P(x\leq 1)$, would be be the summation of n=0 to 2 subtract that of 0 to 1 of the pdf, f(x). the answer here would be -2?

I would really appreciate it if you can clarify any misunderstandings I may have.

• The probability you are looking for is $P(1\leq X\leq 2) = P(X=1) + P(X=2)$ and not $P(X\leq2) - P(X\leq1) = P(X=2)$ as you say. – Michh Oct 16 '17 at 20:26

Identify the parameters for the distribution from the MGF and then find the probability via de the pdf: $$\phi_{Bin(n,p)}(t) = (1-p+pe^t)^n \\ \phi_{Geo(p)}(t) = \frac{p e^t}{1-(1-p)e^t}$$ Then you have that Bin(5,0.7) and Geo(0.3). Now you with those parameters you can find the pdf and compute the probability the way you intended.