I'm trying to solve this set of equations in generality, where $n$ can vary.
$\begin{align*} P_{1}&=1-\sum_{i=2}^{n}P_{i}\\ P_{i}&=\frac{c_{i-1}P_{i-1}}{c_{i}+\mu_{i}}, \quad i=2,\dots,n-1\\ P_{n}&=\frac{c_{n-1}P_{n-1}}{\mu_{n}} \end{align*}$
I've had luck solving specific special cases, for example when $n=3$, I've used:
Solve[
P1 == 1 - (P2 + P3) &&
P2 == (c1*P1)/(c2 + mu2) &&
P3 == (c2*P2)/(mu3),
{P1, P2, P3}
] // FullSimplify
{{P1 -> ((c2 + mu2) mu3)/(c1 c2 + (c1 + c2 + mu2) mu3),
P2 -> (c1 mu3)/(c1 c2 + (c1 + c2 + mu2) mu3),
P3 -> (c1 c2)/(c1 c2 + (c1 + c2 + mu2) mu3)}}
However, I'm struggling to use RSolve
to do it in generality, I'm not sure if the issue has to do with my use of Indexed
on the coefficients c and mu, or something else. My attempt is in the code block below. Many thanks in advance to any issues that can be pointed out!
eqns = {
P[nmax] == (Indexed[c, nmax - 1]*P[nmax - 1])/Indexed[mu, nmax],
P[n] == (Indexed[c, n - 1]*P[n - 1])/(Indexed[c, n] + Indexed[mu, n]),
P[1] == 1 - Sum[P[i], {i, 2, nmax}]
};
RSolve[eqns, P[n], n]