Finding the moment generating function with a probability mass function

We have the probability mass function for a random variable $X$ given in table form:

$$\begin{array}{c|cccc} x & 1 & 2 & 3 & 4 \\ f(x) & 0.1 & 0.25 & 0.3 & 0.35 \end{array}$$

I have to derive the moment generating function from this data. I can do this if the function is given but this particular case is confusing me.

I think $X$ is a discrete random variable so we would have to use the mgf summation formula, but I'm not sure how - do I need to figure out what the function is first based on the data in the table?

• The function is given. You say you would have to use a formula. But that is never the first thing you should think of. You get $\operatorname E(e^{tX}) = e^{t\cdot1} \Pr(X=1) + e^{t\cdot2} \Pr(X=2) +\cdots. \qquad$ – Michael Hardy Aug 21 '18 at 2:16

$$P(X=x) = \begin{cases} 1 & \text{w.p. } 0.1 \\ 2 & \text{w.p. } 0.25 \\ 3 & \text{w.p. } 0.3 \\ 4 & \text{w.p. } 0.35 \end{cases}$$
$$\mathbb{E}[\exp(tX)]=\sum_{x=1}^4\exp(tx)P(X=x)$$