6

When I evaluate this code:

RSolve[{y[0] == y0, y[t + 1] == (1 - (t + 1)/100) y[t]}, y[t], t]

I get an RSolve::bvnul error. I don't understand why.

Yet, if I run this code, I get the sequence I want.

FoldList[#1 (1 - #2) &, 1, Range[1/100, 1, 1/100]]

The motivation for this problem is a discrete mortality model in which hazard increases in a linear way until age 100. I'd like a closed form solution for the sequence for an arbitrary maximum life span.

Seth Chandler
  • 3,132
  • 14
  • 25

1 Answers1

10

Edit

If the corresponding model is to be used for a lifespan L, then RSolve works:

RSolve[{y[0] == y0, y[1 + t] == (1 + 1/L (-1 - t)) y[t]}, y[t], t]
(* {{y[t] -> -(-1 + L) (-L)^-t y0 Pochhammer[2 - L, -1 + t]}} *)

I suspect that RSolve fails because 1 - (t + 1)/100 becomes zero. Although mathematically that shouldn't matter, algorithmically it may.

Original

Is this not the same thing?

Product[(1 - t/100), {t, 1, n}] y0
(* (-(1/100))^n Pochhammer[-99, n] y0 *)

DiscretePlot[(-(1/100))^n Pochhammer[-99, n], {n, 0, 100}, PlotRange -> All]

DiscretePlot

Check:

FoldList[#1 (1 - #2) &, 1, Range[1/100, 1, 1/100]] == 
 Table[(-(1/100))^n Pochhammer[-99, n], {n, 0, 100}]
(* True *)

(One can also substitute an arbitrary lifespan L for 100 in the Product.)

Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • Case closed. Thanks! Kind of strange how the problem works for an arbitrary lifespan L but does not work when puts in a particular value. And, yes, your Product alternative is at least as good as my FoldList. – Seth Chandler Apr 16 '13 at 00:38