Re: Help on a recursive function
- To: mathgroup at smc.vnet.net
- Subject: [mg52929] Re: [mg52895] Help on a recursive function
- From: DrBob <drbob at bigfoot.com>
- Date: Fri, 17 Dec 2004 05:18:48 -0500 (EST)
- References: <200412160840.DAA27279@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
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}
(So your result for H=1 looks wrong.)
p[2] /@ Range@5
{a*(1 + b), a*(1 + b + b^2),
a*(1 + b + b^2 + b^3),
a*(1 + b + b^2 + b^3 + b^4),
a*(1 + b + b^2 + b^3 + b^4 + b^5)}
p[3] /@ Range@5
{a*(1 + b), a*(1 + b)^2,
a*(-b + (1 + b)^3),
a*(1 + 2*b + 4*b^2 + 4*b^3 +
b^4), a*(1 + b)^2*
(1 + 3*b^2 + b^3)}
As for the limit, try H=3, b=0.5, for i = 100 and i = 250:
{p[3][100], 1/(1-b)}/.b->0.5
{67.5556 a, 2.}
{p[3][250], 1/(1-b)}/.b->0.5
{167.556 a, 2.}
The limit CLEARLY depends on a, and 1/(1-b) doesn't look viable even if a=1.
Make sure you have the definition right, and THEN you can look for closed forms.
Bobby
On Thu, 16 Dec 2004 03:40:30 -0500 (EST), <smollest at supereva.it> wrote:
>
> I'm interested on the behaviour on a H-length circular queue, empty before i=0, equal to P(0)=a and P(i)= b Sum(j=i-1, i-H [P(j)]), that is:
>
> P(i) = a(1+b)^i i=0, ..., H-1
>
> P(i) = (1+b)P(i-1) - b P(i-H) i>= H
>
>
> I got just the following results:
>
> P(i) = a (b(i+1) - 1)/(b - 1) *if H=1*
>
> and
>
> lim(i->Inf [ P(i) ]) = 1 / (1-b) for each H, if | b | <1
>
> my question is: is it possible to express this function in closed form for each H?
>
> thank you in advance,
> smoll-est
>
>
>
>
--
DrBob at bigfoot.com
www.eclecticdreams.net
- References:
- Help on a recursive function
- From: smollest@supereva.it
- Help on a recursive function