Is there a way to write a recursive formula as a sum from 1 to n (or in any other non-recursive way?

50 Views Asked by At

What I would like is a formula that tells me the probability of winning a game given what "state" the game is in. I have denoted the "states" of the game as $K_i$ and I have defined a recursive function $\phi(K_i)$ that gives the probabilities of winning. With $K_2=\frac{1}{2}$ and $K_3=\frac{1}{3}$. Given the function:

$ \phi(K_i)=\frac{1}{i}+\frac{i-1}{i}\cdot \phi(K_{i-2}) $

Is there any method that allows me to cleanly convert this recursive formula into a non-recursive formula? Since $K_2$ and $K_3$ are different I am perfectly fine with the function being piecewise.