[ 
https://issues.apache.org/jira/browse/MATH-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nimo mayr updated MATH-1652:
----------------------------
    Description: 
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}

  was:
The class {color:#d8d8d8}
{color}
{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}


> 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)

Reply via email to