## Probability problem to do with generating functions

A slot machine operates in such a way that at the first turn your probability of winning
is 1/2. Thereafter, your probability of winning is 1/2 if you lost at the last turn and p
(which is less than 1/2) if you won. If un is the probability that you win at the nth turn,
and a recurrence relation that connects un and un+1 whenever n ^ 2