Christian Krause on Sun, 23 Oct 2022 19:19:04 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: binomial coefficient with negative args


Thanks for the quick response! Looking forward to the next release to test it (we generate GP code from LODA and this is were the issue popped up).

Cheers,
Christian 


On Sun 23. Oct 2022 at 15:33, Karim Belabas <Karim.Belabas@math.u-bordeaux.fr> wrote:
* Christian Krause [2022-10-22 21:46]:
> Hi,
> the binomial coefficient in GP behaves differently than I thought for
> negative arguments. For instance, binomial(-2,-4) yields 0 (zero). In
> Wolfram Alpha the result is 3. The paper by Kronenburg
> <https://arxiv.org/pdf/1105.3689.pdf> states this:
>
> [image: image.png]
>
> For binomial(-2,-4), the second case applies: (-1)^(-2+4) *
> binomial(4-1,-2+4) = binomial(3,2) = 3. This is consistent with Wolfram
> Alpha. They also document the same definition here
> <https://mathworld.wolfram.com/BinomialCoefficient.html>.
>
> Why does PARI/GP yield different results for binomial() with negative
> arguments?

The extension binomial(x, k) for negative n and k was not implemented.
Just did this in the 'master' branch following Kronenburg's extension,
updating the documentation in the process.

Please test !

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251), Université de Bordeaux
Vice-président en charge du Numérique
T: (+33) 05 40 00 29 77; http://www.math.u-bordeaux.fr/~kbelabas/
`