[
https://issues.apache.org/jira/browse/MATH-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627648#comment-17627648
]
Alex Herbert edited comment on MATH-1652 at 11/2/22 11:40 AM:
--------------------------------------------------------------
This is now in the combinatorics package of Commons Numbers:
[Numbers javadoc for
combinatorics|https://commons.apache.org/proper/commons-numbers/commons-numbers-docs/apidocs/org/apache/commons/numbers/combinatorics/package-summary.html]
[Numbers user guide for
combinatorics|https://commons.apache.org/proper/commons-numbers/userguide/index.html#Combinatorics]
Note that the new equivalent method {{long BinomialCoefficient.value(int n, int
k)}} does not provide the definition formula in the documentation. It provides
a link to online resources which contain the definition and further information.
The recent 1.1 release of Numbers improved the implementation over the method
used in Commons Math (see
[Numbers-183|https://issues.apache.org/jira/browse/NUMBERS-183]).
was (Author: alexherbert):
This is now in the combinatorics package of Commons Numbers:
[Numbers javadoc for
combinatorics|https://commons.apache.org/proper/commons-numbers/commons-numbers-docs/apidocs/org/apache/commons/numbers/combinatorics/package-summary.html]
[Numbers user guide for
combinatorics|https://commons.apache.org/proper/commons-numbers/userguide/index.html#Combinatorics]
Note that the new equivalent method {{long BinomialCoefficient.value(int n, int
k)}} does not provide the definition formula in the documentation. It provides
a link to online resources which contain the definition and further information.
The recent 1.1 release of Numbers improved the implementation over the method
used in Commons Math (see Numbers-183).
> comments about the formula of binomialCoefficient wrong
> -------------------------------------------------------
>
> Key: MATH-1652
> URL: https://issues.apache.org/jira/browse/MATH-1652
> Project: Commons Math
> Issue Type: Improvement
> Reporter: nimo mayr
> Priority: Minor
>
> The class
> {code:java}
> org.apache.commons.math3.util.CombinatoricsUtils{code}
> within the method
> {code:java}
> public static long binomialCoefficient(final int n, final int k){code}
> contains the following comments:
> {code:java}
> // We use the formula
> // (n choose k) = n! / (n-k)! / k!
> // (n choose k) == ((n-k+1)...*n) / (1...*k)
> // which could be written
> // (n choose k) == (n-1 choose k-1) * n / k
> {code}
> I think, the second line
> {code:java}
> (n choose k) = n! / (n-k)! / k!{code}
> must be written to
> {code:java}
> (n choose k) = n! / (n-k)! * k!{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)