I am trying to solve a system of recurrence relations as follows.
RSolve[{a[p] == 1 + (2/n) b[p - 1] + ((p - 1)/n) a[p - 1],
b[p] == 1 + (p/n) b[p - 1],
a[1] == 1 + 2/n,
b[0] == 1},
{a[p], b[p]}, p]
Having done this, I would like to set $p=n-1$ and then plot the resulting functions $a[n-1]$ and $b[n-1]$ for $n=1, ..., 1000$.
I am failing at the first hurdle as Mathematica version 8 just returns the RSolve line when I press shift-enter.
Update. Following a request for an example using Maple 16. I do the following.
rsolve({a(1) = 1+2/n, a(p) = 1+(p-1)*a(p-1)/n+2*b(p-1)/n, b(0) = 1, b(p) = 1+p*b(p-1)/n}, {a(p), b(p)});
subs(p = n-1, %);
I then copy the result for a(n-1) and plot it
plot([seq([n, (1/n)^(n-1)*n*GAMMA(n-1)*(Sum((n+2*(1/n)^p1*exp(n)*GAMMA(p1+1, n))/(n^2*(1/n)^(p1+1)*GAMMA(p1+1)), p1 = 1 .. n-2)+1+2/n)], n = 2 .. 200)], style = point);
This gives
Comments
Post a Comment