I'm working on a problem involving recency rank encoding in which I must find some probabilities that I'm having issues calculating.

Given a source alphabet $\displaystyle S = \{s_{1}, ..., s_{m}\}$ with zeroth order relative frequencies $\displaystyle f = \{f_{1}, ..., f_{m}\}$, I need to find the probabilities $\displaystyle p_{0}, ..., p_{m-1}$ where $\displaystyle p_{i}$ is the probability that between the occurence of a particular source letter and the previous occurence of that same source letter, there are i different source letters (i.e. the last $\displaystyle s_{3}$ in the source texts $\displaystyle s_{3}s_{1}s_{2}s_{3}$ and $\displaystyle s_{3}s_{2}s_{1}s_{2}s_{3}$ would be encoded with a codeword $\displaystyle u_{2}$ in both cases since there are only two *different* source letters between the occurences of $\displaystyle s_{3}$). I am trying to find formulas for each of these $\displaystyle p_{i}$, especially $\displaystyle p_{0},\ p_{1},\ p_{2}$. Could anyone give me some tips on how to find these probabilities?