Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ppurka opened this issue Jul 16, 2013 · 0 comments
Open

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

ppurka opened this issue Jul 16, 2013 · 0 comments

Comments

@ppurka
Copy link
Member

ppurka commented Jul 16, 2013

Essentially, this stuff

sage: binomial(10, 0.1)
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)
1.32919082253922

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.

Component: basic arithmetic

Keywords: binomial

Issue created by migration from https://trac.sagemath.org/ticket/14897

@ppurka ppurka added this to the sage-6.1 milestone Jul 16, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants