(49g/50g) Falling and Rising Factorials
|
02-05-2021, 08:32 PM
Post: #1
|
|||
|
|||
(49g/50g) Falling and Rising Factorials
Here are several programs for computing values of falling and rising factorials. I am posting them as a directory object for convenience but there are no inter-dependencies between the programs, so unused programs can be removed without affecting the others. Most of the programs require the ListExt library.
The first three programs are general-purpose programs. FALFAC computes the falling factorial x_n. n must be an integer (positive or negative), x may be integer, real, complex or symbolic. POCH computes the rising factorial (x)n also known as the Pochhammer symbol. Same rules as above. QPOCH computes the q-Pochhammer symbol (a;q)n, a generalization of the rising factorial that accepts 3 arguments. Details here. n must be an integer, a and q may be integer, real, complex or symbolic. The next two programs, ZFALFAC and ZPOCH compute the falling and rising factorials respectively. The difference is that n may be real or complex, but cannot be a negative integer. Also, since the programs return floating-point numbers, accuracy is limited to 12 digits. The last three programs, ZFF, ZPOCH and ZQP are simplified versions of the first three. n must be an integer > 0, and x, a, and q must be integers (positive or negative). They are meant to be used where speed is important, e. g. inside loops. Except for ZFALFAC and ZPOCH the only limitation on the size of integers is calculator memory. Examples: 'x' 4 POCH EVAL will return 'x^4+6*x^3+11*x^2+6*x', where the coefficients are the unsigned Stirling numbers of the first kind. 'x' 4 FALFAC EVAL will return 'x^4-6*x^3+11*x^2-6*x', where the coefficients are the signed Stirling numbers of the first kind. 'x' 2 4 QPOCH EVAL will return '64*x^4-120*x^3+70*x^2-15*x+1'. The coefficients are more complicated but are related to the Gaussian binomial coefficients. Code:
|
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(49g/50g) Falling and Rising Factorials - John Keith - 02-05-2021 08:32 PM
RE: (49g/50g) Falling and Rising Factorials - John Keith - 04-19-2021, 07:47 PM
|
User(s) browsing this thread: 2 Guest(s)