Opened 7 years ago

Last modified 6 years ago

#14897 new enhancement

binomial(x, m) gives incorrect answer when m is float

Reported by: ppurka Owned by: AlexGhitza
Priority: major Milestone: sage-6.4
Component: basic arithmetic Keywords: binomial
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:


Essentially, this stuff

sage: binomial(10, 0.1)

What I would have expected it to give as output is

sage: gamma(10+1)/gamma(10-0.1+1)/gamma(0.1+1)

This enhancement has to be done on the sage side since both mpir and pari don't give the correct answer. Using the gamma function in these special cases will also take care of complex numbers.

But, we must avoid changing the whole implementation to the gamma function - that was also giving incorrect results and was fixed in #12448. The sage.rings.arith.binomial function itself is a bit of a mess and it is hard to figure out what will eventually get executed in that code.

Change History (3)

comment:1 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:2 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.