Re: Re: Help on a recursive function
- To: mathgroup at smc.vnet.net
- Subject: [mg53099] Re: [mg53057] Re: Help on a recursive function
- From: DrBob <drbob at bigfoot.com>
- Date: Thu, 23 Dec 2004 07:59:05 -0500 (EST)
- References: <200412160840.DAA27279@smc.vnet.net> <cpue6s$gb6$1@smc.vnet.net> <200412220952.EAA04431@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
I think this matches your new "complete formal": Clear@p p[H_][i_Integer] /; 0 â?¤ i < H := p[H][i] = a(1 + b)^i p[H_][i_Integer?Positive] := p[H][i] = Simplify[(1 + b)p[H][i - 1] - b p[H][i - H - 1]] But that leaves things undefined. For instance: p[1][1] a + a*b - b*p[1][-1] and p[2][2] a*(1 + b)^2 - b*p[2][-1] You haven't defined p at -1. Bobby On Wed, 22 Dec 2004 04:52:47 -0500 (EST), Smoll Est <smollest at supereva.it> wrote: > DrBob wrote: >> If I've copied the definition right, here are a few terms for H = 1, 2, and 3: >> >> Clear@p >> p[H_][i_Integer] /; 0 <= i < H := p[H][i] = a(1 + b)^i >> p[H_][i_Integer?Positive] := p[H][i] = >> Simplify[(1 + b)p[H][i - 1] - b p[H][i - H]] >> >> p[1] /@ Range@5 >> {a, a, a, a, a} > > Hello Bobby, > thank you for your attention first of all; I made a *mistake* in the > previous formula; instead of: > >>> P(i) = (1+b)P(i-1) - b P(i-H) i>= H > > the true formula is: > > P(i) = (1+b)P(i-1) - b P(i-H-1) i>= H > > that is "P(i-H-1)" instead of "P(i-H)" > > and the limit where: > > a / (1-b) > > so, the complete formal is: > > P(i) = a(1+b)^i i=0, ..., H-1 > > P(i) = (1+b)P(i-1) - b P(i-H-1) i>= H > > any idea for its expression in a closed form? > > smoll-est > > > > -- DrBob at bigfoot.com www.eclecticdreams.net
- References:
- Help on a recursive function
- From: smollest@supereva.it
- Re: Help on a recursive function
- From: Smoll Est <smollest@supereva.it>
- Help on a recursive function