Opened 10 years ago

Closed 10 years ago

#8651 closed defect (fixed)

binomial(n,k) evaluates to zero when 0 is subsituted for k

Reported by: rhinton Owned by: burcin
Priority: major Milestone: sage-4.4.4
Component: symbolics Keywords: pynac, binomial
Cc: jason Merged in: sage-4.4.4.alpha0
Authors: Burcin Erocal, Jens Vollinga Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

We all know binomial(n,0) should be 1. But we're not getting that answer in the following case.

sage: var('n, k')
(n, k)
sage: binomial(n, 0)  # this is OK
1
sage: binomial(n, k).subs(k=0)  # this is a problem!
0

Attachments (1)

trac_8651-binomial.patch (764 bytes) - added by burcin 10 years ago.
add doctests

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by burcin

  • Keywords pynac added; symbolic removed

Good catch! I recall this being fixed in GiNaC recently. I'll import the relevant patch into pynac and make an updated package.

comment:2 Changed 10 years ago by jason

  • Cc jason added

Changed 10 years ago by burcin

add doctests

comment:3 Changed 10 years ago by burcin

  • Authors set to Burcin Erocal, Jens Vollinga

I uploaded a patch with the doctest, new pynac package with the fix coming soon.

comment:4 Changed 10 years ago by burcin

  • Status changed from new to needs_review

Corresponding pynac package is available at #8903. Note that the new package also contains fixes for #8542, #8688, #8775. Patches from these tickets should be applied before running doctests.

comment:5 Changed 10 years ago by mhansen

  • Reviewers set to Mike Hansen
  • Status changed from needs_review to positive_review

Looks good to me. This can be merged now.

comment:6 Changed 10 years ago by mhansen

  • Merged in set to sage-4.4.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.