Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stirling.matrix

Stirling Matrix


Description

This function constructs and returns a Stirling matrix which is a lower triangular matrix containing the Stirling numbers of the second kind.

Usage

stirling.matrix(n)

Arguments

n

A positive integer value

Details

The Stirling numbers of the second kind, S_i^j, are used in combinatorics to compute the number of ways a set of i objects can be partitioned into j non-empty subsets j ≤ i. The numbers are also denoted by ≤ft\{ {\begin{array}{*{20}{c}}i\\j\end{array}} \right\}. Stirling numbers of the second kind can be computed recursively with the equation S_j^{i + 1} = S_{j - 1}^i + j\;S_j^i,\quad 1 ≤ i ≤ n - 1,\;1 ≤ j ≤ i. The initial conditions for the recursion are S_i^i = 1,\quad 0 ≤ i ≤ n and S_j^0 = S_0^j = 0,\quad 0 ≤ j ≤ n. The resultant numbers are organized in an order n + 1 matrix ≤ft[ {\begin{array}{*{20}{c}} {S_0^0}&0&0& \cdots &0\\ 0&{S_1^1}&0& \cdots &0\\ 0&{S_1^2}&{S_2^2}& \cdots &0\\ \cdots & \cdots & \cdots & \cdots & \cdots \\ 0&{S_1^n}&{S_2^n}& \cdots &{S_n^n} \end{array}} \right].

Value

An order n + 1 lower triangular matrix.

Note

If the argument n is not a positive integer, the function presents an error message and stops.

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

Aceto, L. and D. Trigiante (2001). Matrices of Pascal and Other Greats, American Mathematical Monthly, March 2001, 108(3), 232-245.

Examples

S <- stirling.matrix( 10 )
print( S )

matrixcalc

Collection of functions for matrix calculations

v1.0-3
GPL (>= 2)
Authors
Frederick Novomestky <fnovomes@poly.edu>
Initial release
2012-09-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.