[Corrected equations and added simple example]
Can you solve a system of (loosely) coupled recurrence relations like this in Mathematica somehow?
{A[k] ==1+((n-k-2)/n) A[k+1] +(2/n) B[k+1] + (k/n) (A[0]),
B[k]==1+((n-k-1)/n) B[k+1] + (k/n) A[0]}
We want to solve it for $A[0]$ as a closed form function of $n$.
$A[k]$ is defined for $0 \leq k \leq n-2$ and $B[k]$ is defined for $1 \leq k \leq n-1$.
Version 8 doesn't do anything useful but I suspect I am not asking it in the right way.
As a simple example, if you set $n=3$ then you get four simulataneous equations.
A[0] == 1 + (2/3)*B[1] + (1/3)*A[1]
B[1] == 1 + (1/3)*A[0] + (1/3)*B[2]
B[2] == 1 + (2/3)*A[0]
A[1] == 1 + (2/3)*B[2] + (1/3)*A[0]
Solving for $A[0]$ gives you $33/5$ I believe. To start things off, how do you get Mathematica to do this?
Update. If you just take the second recurrence alone.
B[k]==1+((n-k-1)/n) B[k+1] + (k/n) A[0]
How can you get Mathematica to give a sensible solution for $B[k]$ in terms of $n$ and $A[0]$? It seems Rsolve ought to be able to do this. I even tried
RSolve[{B[k] == 1 + ((n - k - 1)/n) B[k + 1] + ((k)/n) (A[0]),
B[n - 1] == k A[0]/n}, B[k], k]
which should be identical. However this now gives an empty solution with the following warning.
RSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution.
I would like to tell Mathematica to only try to solve it for the defined range of $k$. Is that possible?
A[0]
with constant and solve first forB[k]
then solve forA[k]
and replaceB[k]
with previous solution it works. $\endgroup$A[0]
. SoRSolve[B[k]==1+((n-k-2)/n) B[k+1]+((k+1)/n) (k+A[0]),B[k],k]
is able to cope with it. $\endgroup$n
though, you get very long expressions. $\endgroup$