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

 Re: binomial coefficient with negative args

• To: pari-users@pari.math.u-bordeaux.fr
• Subject: Re: binomial coefficient with negative args
• From: Christian Krause <me@ckrause.org>
• Date: Sun, 23 Oct 2022 19:17:51 +0200
• Delivery-date: Sun, 23 Oct 2022 19:19:04 +0200
• References: <CAM_+VSMctVGiRLQvdH0RJVBHGi4wYRoJG7HywQWAAU=kaxyhtA@mail.gmail.com> <Y1VChs6dmxbKWZcI@math.u-bordeaux.fr>

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.