Skip to content

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

Open
@ppurka

Description

@ppurka

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions