Macaulay2 » Documentation
Packages » Macaulay2Doc » combinatorics » binomial
next | previous | forward | backward | up | index | toc

binomial -- binomial coefficient

Description

i1 : binomial(13,6)

o1 = 1716
i2 : binomial(-1,3)

o2 = -1

When either n or k are not ZZ objects, the Gamma function is used, i.e., $\binom{n}{k} = \frac{\Gamma(n + 1)}{\Gamma(k + 1)\Gamma(n - k + 1)}$.

i3 : binomial(7.5, pi)

o3 = 46.76478688243245

o3 : RR (of precision 53)

A polynomial may also be used for n.

i4 : R = QQ[x]

o4 = R

o4 : PolynomialRing
i5 : binomial(x + 3, 3)

     1 3    2   11
o5 = -x  + x  + --x + 1
     6           6

o5 : R

Ways to use binomial:

  • binomial(Number,Number)
  • binomial(RingElement,ZZ)
  • binomial(ZZ,ZZ)

For the programmer

The object binomial is a method function.


The source of this document is in Macaulay2Doc/functions/binomial-doc.m2:36:0.