#17123: Extending binomial(n,k) to negative integers n, k.
-----------------------------+----------------------------
Reporter: pluschny | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: sage-6.4
Component: combinatorics | Keywords: binomial
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------
A simple and coherent extension of the binomial function
to negative integers n, k was outlined by M. J. Kronenburg in
The Binomial Coefficient for Negative Arguments,
http://arxiv.org/abs/1105.3689
(Thanks to John Palmieri for the reference.)
This extension amounts to define
{{{
def BINOMIAL(n, k):
if n in ZZ and k in ZZ:
if n >= 0 and k >= 0:
return binomial(n, k)
if k >= 0:
return (-1)^k*binomial(-n+k-1, k)
if k <= n:
return (-1)^(n-k)*binomial(-k-1, n-k)
return 0
else:
return binomial(n, k)
}}}
Here 'BINOMIAL' is the targeted version, 'binomial' the
implemented version. The targeted behaviour is identical
to the behaviour of the Maple and Mathematica function
for negative integers n, k.
--
Ticket URL: <http://trac.sagemath.org/ticket/17123>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.