/** * Returns the <a * href="http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html"> * Stirling number of the second kind</a>, "{@code S(n,k)}", the number of * ways of partitioning an {@code n}-element set into {@code k} non-empty * subsets. * <p> * The preconditions are {@code 0 <= k <= n } (otherwise * {@code NotPositiveException} is thrown) * </p> * @param n the size of the set * @param k the number of non-empty subsets * @return {@code S(n,k)} * @throws NotPositiveException if {@code k < 0}. * @throws NumberIsTooLargeException if {@code k > n}. * @throws MathArithmeticException if some overflow happens, typically for n exceeding 25 and * k between 20 and n-2 (S(n,n-1) is handled specifically and does not overflow) * @since 3.1 * @deprecated use {@link CombinatoricsUtils#stirlingS2(int, int)} */ @Deprecated public static long stirlingS2(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException { return CombinatoricsUtils.stirlingS2(n, k); }
/** * Returns the <a * href="http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html"> * Stirling number of the second kind</a>, "{@code S(n,k)}", the number of * ways of partitioning an {@code n}-element set into {@code k} non-empty * subsets. * <p> * The preconditions are {@code 0 <= k <= n } (otherwise * {@code NotPositiveException} is thrown) * </p> * @param n the size of the set * @param k the number of non-empty subsets * @return {@code S(n,k)} * @throws NotPositiveException if {@code k < 0}. * @throws NumberIsTooLargeException if {@code k > n}. * @throws MathArithmeticException if some overflow happens, typically for n exceeding 25 and * k between 20 and n-2 (S(n,n-1) is handled specifically and does not overflow) * @since 3.1 * @deprecated use {@link CombinatoricsUtils#stirlingS2(int, int)} */ @Deprecated public static long stirlingS2(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException { return CombinatoricsUtils.stirlingS2(n, k); }