Re: Unexpected result with RSolve?
- To: mathgroup at smc.vnet.net
- Subject: [mg33637] Re: [mg33629] Unexpected result with RSolve?
- From: Rob Pratt <rpratt at email.unc.edu>
- Date: Thu, 4 Apr 2002 19:39:56 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On Wed, 3 Apr 2002 wouter.van.den.broeck at vub.ac.be wrote: > Hey, > > There's probably a sound solution, but i'm struggling to grab it: > > RSolve[{a[n + 1] == n a[n], a[0] == 1}, a[n], n] > > returns: > {{a[n] -> 0}} > > where, i believe it 'should' return > {{a[n] -> (n-1)!}} > > Anyone care to give me some directions as to why this 'unexpected' > result? > > (note: I started of with the standard textbook example: > RSolve[{a[n] == n a[n-1], a[0] == 1}, a[n], n] > which returns > {{a[n] -> n!}} > so there's no need to correct me in this direction, I just explored a > bit, and wonder why i'm getting that result with the variation above) > > TIA > > wouter vdb If you use your recursive formula to compute a[n] by hand, you will find that a[1] = 0*a[0] = 0, a[2] = 1*a[1] = 0, a[3] = 2*a[2] = 0, .... But RSolve's answer of a[n] = 0 is a little misleading since it is true only when n >= 1. If you use a[1] == 1 instead of a[0] == 1, RSolve will return your desired answer (n - 1)!. Rob Pratt Department of Operations Research The University of North Carolina at Chapel Hill rpratt at email.unc.edu http://www.unc.edu/~rpratt/