Re: recursive relation problem ?
- To: mathgroup at smc.vnet.net
- Subject: [mg13703] Re: recursive relation problem ?
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 15 Aug 1998 04:39:31 -0400
- Organization: University of Western Australia
- References: <6qp2vd$aiu@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
cplai at geocities.com wrote: > I am studying data structure, and always encounter recursive relation > equations. How do I use mathematica to give general solution of > recursive relation. > > For example: f(0)=1; f(1)=1; f(x)=x*f(x-1); Have a look at the DiscreteMath`RSolve` package which is included in the StandardPackages. In[1]:= << "DiscreteMath`RSolve`" In[2]:= RSolve[{f[0] == 1, f[1] == 1, f[x] == x*f[x - 1]}, f[x], x] Out[2]= {{f[x] -> x!}} Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________