probability generating function to probability mass function I was confused in a probability question: Let $Y$ be a random variable, and we know that its probability generating function is 
                      $$G_Y(s)=e^{-3}e^{3s^2}\cdot\left((1/3)s+(2/3)s^2\right)$$
      Then how can we find the p.m.f of Y?
 A: According to the definition of the pgf: $$G_Y(s)=\sum_{y=0}^{\infty} P(Y=y)s^y$$ so we should try to write the given function as series. We have that $$e^{3s^2}=\sum_{y=0}^{\infty}\frac{(3s^2)^y}{y!}=\sum_{y=0}^{\infty}\frac{3^y}{y!}s^{2y}$$ So, combining all the terms together we have that $$\begin{align*}G_Y(s)&=e^{-3}e^{3s^2}\cdot\left((1/3)s+(2/3)s^2\right)=\sum_{y=0}^{\infty}\frac{e^{-3}3^y}{3y!}s^{2y}(s+2s^2)=\\&=\sum_{y=0}^{\infty}\frac{e^{-3}3^y}{3y!}\left(s^{2y+1}+2s^{2y+2}\right)=\sum_{y=0}^{\infty}\frac{e^{-3}3^y}{3y!}s^{2y+1}+\sum_{y=0}^{\infty}\frac{2e^{-3}3^y}{3y!}s^{2y+2}=\\&=\sum_{y \in \mathbb{2N+1}}^{\infty}\frac{e^{-3}3^{\frac{y-1}{2}}}{3\left(\frac{y-1}{2}\right)!}s^y+\sum_{y \in \mathbb{2N_0}}^{\infty}\frac{2e^{-3}3^{\frac{y-2}{2}}}{3\left(\frac{y-2}{2}\right)!}s^{y}\end{align*}$$ (where actually the last step is not needed). So the pmf $f_Y$ of $Y$ is $$f(y):=P(Y=y)=\begin{cases}\large{\frac{e^{-3}3^{\frac{y-1}{2}}}{3\left(\frac{y-1}{2}\right)!}}, & y=1,3, \ldots, 2k+1, \ldots \text{ (odd)} \\ \\ \\ \large{\frac{2e^{-3}3^{\frac{y-2}{2}}}{3\left(\frac{y-2}{2}\right)!}}, & y=2,4,\ldots, 2k, \ldots \text{ (even)} \end{cases}$$ (Check for mistakes in the calculations). It would have been much better to stop before the last equation and write the pmf $f_Y$ of $Y$ as follows: $$f(y):=P(Y=y)=\begin{cases}\large{\frac{e^{-3}3^k}{3k!}}, & y=2k+1, k \in \mathbb N \text{ (y odd)} \\ \\ \\ \large{\frac{2e^{-3}3^k}{3k!}}, & y=2k, k \in \mathbb N_0\text{ (y even)} \end{cases}$$
