MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: recursive relation problem ?


Needs["DiscreteMath`RSolve`"]

RSolve[{f[0] == f[1] == 1, f[n] == n*f[n - 1]}, f[n], n]

{{f[n] -> n!}}

However, the second initial condition is unnecessary:

RSolve[{f[0] == 1, f[n] == n*f[n - 1]}, f[n], n]

{{f[n] -> n!}}

Another example:

Simplify[RSolve[{f[0] == 0, f[1] == 1, 
    f[n] == f[n - 1] + f[n - 2]}, f[n], n]]

{{f[n] -> -(((1/2*(1 - Sqrt[5]))^n - (1/2*(1 + Sqrt[5]))^n)/
       Sqrt[5])}}

Bob Hanlon

In a message dated 8/11/98 6:28:53 AM, 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);


  • Prev by Date: Re: Undocumented 3.0 Features
  • Next by Date: Dimensions and Variables
  • Previous by thread: Re: recursive relation problem ?
  • Next by thread: Re: recursive relation problem ?