[Date Index]
[Thread Index]
[Author Index]
Re: recursive relation problem ?
*To*: mathgroup at smc.vnet.net
*Subject*: [mg13678] Re: [mg13656] recursive relation problem ?
*From*: BobHanlon at aol.com
*Date*: Sat, 15 Aug 1998 04:39:10 -0400
*Sender*: owner-wri-mathgroup at wolfram.com
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 ?**
| |