Theorem 8.5.5. Moment Generating Function for Gamma.
Presuming \(t \lt \frac{1}{\mu}\) where \(\mu\) is the mean waiting time till the first "change" and \(r\) is the number of changes desired,
\begin{equation*}
M(t) = \frac{1}{ \left ( 1-\mu t \right )^{r}}
\end{equation*}