# Use the moment-generating function to find the mean

#### Buckeye

##### Member
I have the moment-generating function for the discrete uniform distribution $$f(x)=\frac{1}{k}$$ for x=1,2,...k:

$$Mx(t)=\frac{e^t(1-e^t)}{k(1-e^t)}$$

I need to take the derivative of this function with respect to t then find the limit as t approaches 0. I've tried L'Hospital's Rule for this limit with no luck. Any suggestions?

#### Dason

Are you sure you have the correct mgf? To me it looks very close but there is a slight difference from what I would expect.

#### Buckeye

##### Member
I made a mistake. It should be $$Mx(t)=\frac{e^t(1-e^{kt})}{k(1-e^t)}$$. Although, I think I run into the same problem.

Last edited:

#### Buckeye

##### Member
$$Mx'(t)=\frac{(k-ke^t)(e^t-e^{kt+t}(k+1))+ke^t(e^t-e^{kt+t})}{(k-ke^t)^2}$$

$$\lim_{t\to 0}Mx'(t)= \mu$$ However, this is of the form 0/0. If I use L'Hospital's rule, I will continue to get 0/0. Any suggestions?

What is the use of this mgf if it isn't helpful?