You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/11/02 16:52:21 UTC

[commons-numbers] 03/03: Add Stirling class to the user guide

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git

commit f3761b623c4e58741ffda13445e373dfae8c0293
Author: aherbert <ah...@apache.org>
AuthorDate: Wed Nov 2 16:46:15 2022 +0000

    Add Stirling class to the user guide
---
 src/site/apt/userguide/index.apt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/site/apt/userguide/index.apt b/src/site/apt/userguide/index.apt
index ac76376e..c7c3f672 100644
--- a/src/site/apt/userguide/index.apt
+++ b/src/site/apt/userguide/index.apt
@@ -295,6 +295,19 @@ list.forEach(c -> System.out.println(Arrays.toString(c)));
 [3, 4, 5]
 +------------------------------------------+
 
+  The <<<Stirling>>> class can evaluate Stirling numbers of the second kind \( S(n, k) \). This is
+  the number of ways of partitioning a set of \( n \) elements into \( k \) non-empty subsets.
+  For example a set of 3 elements may be partitioned into:
+
++------------------------------------------+
+Stirling.stirlingS2(3, 1)    //  1 : {{1}, {2}, {3}}
+Stirling.stirlingS2(3, 2)    //  3 : {{1, 2}, {3}}, {{1, 3}, {2}} and {{1}, {2, 3}}
+Stirling.stirlingS2(3, 3)    //  1 : {{1, 2, 3}}
++------------------------------------------+
+
+  The evaluation is limited by the <<<long>>> datatype and the method will raise an
+  <<<ArithmeticException>>> if the result cannot be represented.
+
 Complex
 
   The {{{../commons-numbers-complex/index.html}commons-numbers-complex}} module