In a sequence of Bernoulli trials let $u_n$ be the probability that the combination $SF$ (success and failure) occurs for the first time at trials number $n-1$ and $n$. Find the generating function.
From here, I know that $u_n = \sum_{i=0}^{n-2}q^{i+1} p^{n-1-i}$. This implies that the generating function is $\sum_{n=0}^\infty(q^1p^{n-1} + \cdot\cdot\cdot + q^{n-1}p^1)s^n$. The answer indicates that this should be reduced to $pqs^2/(1-ps)(1-qs)$. However, I don't know how to reach this. I would appreciate if you give some help.