Re: A=B example
- To: mathgroup at smc.vnet.net
- Subject: [mg32133] Re: [mg32120] A=B example
- From: Rob Pratt <rpratt at email.unc.edu>
- Date: Sat, 29 Dec 2001 00:46:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I don't have access to Mathematica at the moment, but here's a thought. Note that a is not a local variable. Try Clear[]-ing a before repeating the evaluation. Rob Pratt Department of Operations Research The University of North Carolina at Chapel Hill rpratt at email.unc.edu http://www.unc.edu/~rpratt/ On Fri, 28 Dec 2001, Erich Neuwirth wrote: > this has probably been asked before. > being new to the list i would be happy with a pointer to previous > answers. > > > in A=B by Wilf and Zeilberger, > on page 61 there is the following program for deriving recursions > explicitly > (i had to change FactorialSimplify to FullSimplify > because the original version was for mathematica 2.2): > > > findrecur[f_, ii_, jj_] := > Module[{yy, zz, ll, tt, uu, r, s, i, j}, > yy = Sum[ > Sum[a[i, j] *FullSimplify[f[n - j, k - i]/f[n, k]], {i, 0, ii}], > {j, > 0, jj}]; > zz = Collect[Numerator[Together[yy]], k]; > ll = CoefficientList[zz, k]; > tt = Flatten[Table[a[i, j], {i, 0, ii}, {j, 0, jj}]]; > uu = Flatten[Simplify[Solve[ll == 0, tt]]]; > For[r = 0, r <= ii, r++, > For[s = 0, s <= jj, s++, > a[r, s] = Replace[a[r, s], uu]]]; > Sum[Sum[a[i, j] F[n - j, k - i], {i, 0, ii}], {j, 0, jj}] == 0] > > defining > f[n_, k_] := n!/(n - k)! > > and executing > findrecur[f,1,1] > works, > but trying to run exactly the same statement a second time > produces a lot of errors and effectively hangs mathematica. > > is there a solution? > > > > -- > Erich Neuwirth, Computer Supported Didactics Working Group > Visit our SunSITE at http://sunsite.univie.ac.at > Phone: +43-1-4277-38624 Fax: +43-1-4277-9386 > >