       Re: A=B example

• To: mathgroup at smc.vnet.net
• Subject: [mg32129] Re: A=B example
• From: "Allan Hayes" <hay at haystack.demon.co.uk>
• Date: Sat, 29 Dec 2001 00:46:49 -0500 (EST)
• References: <a0h7pl\$ssr\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Erich,
The culprit seem to be the symbol  a; the following works

In:=
findrecur[f_,ii_,jj_]:=
Block[{a},
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\[Equal]0,tt]]];
For[r=0,r\[LessEqual]ii,r++,
For[s=0,s\[LessEqual]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}]\[Equal]0]
]

In:=

f[n_,k_]:=n!/(n-k)!

In:=
findrecur[f,1,1]

Solve::svars:Equations may not give solutions for all "solve" variables.

Out=
a[1, 1]*F[-1 + n, -1 + k] - (a[1, 1]*F[n, k])/n == 0

In:=
findrecur[f,1,1]

Solve::svars: Equations may not give solutions for all "solve" variables.

Out=
a[1, 1]*F[-1 + n, -1 + k] - (a[1, 1]*F[n, k])/n == 0

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Erich Neuwirth" <erich.neuwirth at univie.ac.at> wrote in message
news:a0h7pl\$ssr\$1 at smc.vnet.net...
> this has probably been asked before.
> being new to the list i would be happy with a pointer to previous
>
>
> 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