TITLE: Determining probability generating function for event "$SS$"
QUESTION [5 upvotes]: Given a sequence of Bernouilli trials, we have $P(S) = \frac{2}{3}$ with $0<p<1$. The event "SS" occurs on the $i$-th trial if we observe an $S$ on the $i$-th trial following a $S$ on the $(i-1)$-th trial. We let $Q$ be the waiting time random variable to see the first event "SS". Show that the probability generating function of $Q$ is given by 
  $$
\frac{4}{27}s^{2}\bigg(\dfrac{2}{1-\frac{2}{3}s} + \dfrac{1}{1+\frac{1}{3}s}\bigg)
$$

I cannot determine how to approach this question to get the probability generating function in that form. My first thought is to let $Q_{1}$ be the waiting time for the first "$S$", and let $Q_{2}$ be the waiting time for the second "$S$" after getting the first "$S$". 
Then $Q_{1} \sim Geo(\frac{2}{3})$, and $Q_{2} \sim Geo(\frac{2}{3})$, and as they are independent I can multiply their respective probability generating functions to get the probability generating function for $Q$. 
But this gives me 
$$
\dfrac{\frac{4}{9}s^{2}}{(1-\frac{1}{3}s)^{2}}$$
which I cannot simplify to be the requested form. This leads me to think that I made an error in my approach, and I should be approaching this question completely differently.

REPLY [2 votes]: robjohn already has a solid answer for you, but here's another approach if you're more inclined to conditioning, which I see you considered in the comments. 

Let $Q_{1}$ be the waiting time for the first "$S$". Then, as you noted, $Q_{1} \sim Geo(\frac{2}{3})$. Now we condition on the $(Q_{1}+1)$-th trial. 
We have that 
\begin{equation*}
    Q= 
\begin{cases}
    1+Q_{1},& \text{if } (Q_{1}+1)\text{-th trial is "S"}\\
    1 + Q_{1} + R,              & \text{if } (Q_{1}+1)\text{-th trial is not "S"}
\end{cases}
\end{equation*}
where $R$ is the remaining time to get "$SS$" after getting a failure. Note that $R$ and our event $Q$ have the same distribution, i.e. $E(S^{R}) = E(S^{Q})$
Now conditioning, 
\begin{align*}
G(s) = E(s^{Q}) &= E(s^{1+Q_{1}}) \cdot P[(Q_{1}+1) \text{-th trial is "S"}] + E(s^{1+Q_{1} + R}) \cdot P[(Q_{1}+1) \text{-th trial is "F"}] \\
&=s \cdot E(s^{Q_{1}}) \cdot \frac{2}{3} + s \cdot E(s^{Q_{1}}) \cdot E(s^{Q}) \cdot \frac{1}{3}
\end{align*}
Now you know the probability generating function of $Q_{1}$ as it is geometrically distributed, and you solve for $E(s^{Q})$ accordingly. You should end up with $\dfrac{4s^{2}}{9-3s-2s^{2}}$, and partial fractions will get you to your desired result. 

What's wrong with your approach:
You cannot simply take the summation of $Q_{1}$ and $Q_{2}$ to find your probability generating function for $Q$, as you require the second "$S$" to occur immediately after the first one. Were you looking for the event of the first occurrence of the pattern "$SF$" say, then you could use a summation like you did. This would work because your pattern would not be "resetting" with each subsequent "$S$" before your required "$F$".