Wednesday, October 31, 2012

Monotone increasing sequences

Monotone increasing functions preserve some ordering relation. In this case, we will consider functions and sequences that are increasing in quantity such as those produced by range:
(= (range 4) '(0 1 2 3))
Ranges are all increasing by one. However, some values may be increasing to an increasing extent. This can be determined by the antireduce function:
(= (antireduce - '(0 1 3 6 10))
   '(0 1 2 3 4))
The triangular numbers are produced by additively reducing over the range and tetrahedral numbers are produced by using the same process on the triangular numbers. The fibonanci numbers are the additive reductions of themselves. Furthermore, the factorial function is produced by the multiplication reduction over the range.

No comments:

Post a Comment