I am trying to find the moment generating function from a piecewise CDF that has constant values:
$$F(x)=\begin{cases} 0, & \text{if } x<0, \\ \frac14, & \text{if } 0\le x<2,\\ \frac34, & \text{if } 2\le x<4,\\ 1, & \text{if } x \ge 4.\\\end{cases}$$
But if I take the derivative of this to get the pdf from which I can calculate expected value, I would get $0$, since the cumulative distribution function is constant. So wold the mgf just be $0$?
Since the CDF is piecewise constant, the distribution is a discrete distribution.
Let me write out the PMF:
$$P(X=0)=\frac14, P(X=2)=\frac34-\frac14, P(X=4)=1-\frac34$$
Can you write down the MGF now?