On Sat, Oct 17, 2009 at 10:30 AM, Johann "Myrkraverk" Oskarsson <joh...@myrkraverk.com> wrote: > Hi all, > > In sage, as of 4.1.1, binomial( -7, 1 ) returns -7. As I understand the > definition of binomial, this should be 0, since there is no set with -7 > elements.
Great question! The binomial function binomial(x,k) can be viewed as counting the number ways of choosing a k-element subset of a set with x elements when x is a nonnegative integer. For any such x, we have the formula: binomial(x,k) = ((x-(k-1))*(x-(k-2))*...*x)/factorial(k) Now if we view x as an indeterminate, then binomial(x,k) can also be interpreted as a *polynomial* in x. For example, binomial(x,3) = 1/6*x^3 - 1/2*x^2 + 1/3*x and binomial(x,1) = x This defines a natural extension of the binomial function to numbers x that aren't nonnegative integers. This definition is useful in many areas of mathematics -- coincidentally, yesterday Ralph Greenberg used it in a class I'm auditing to construct Kubota-Leopold p-adic L-functions that interpolate values of the Riemann zeta function. The above definition of binomial is documented if you type "binomial?" in Sage. This is also arguable the standard usage of "binomial", since it is the same in Mathematica, Maple, Maxima, Pari, GAP, and Magma: sage: mathematica('Binomial[-7,1]') -7 sage: maple('binomial(-7,1)') -7 sage: pari('binomial(-7,1)') -7 sage: maxima('binomial(-7,1)') -7 sage: gap('Binomial(-7,1)') -7 sage: magma('Binomial(-7,1)') -7 > Axiom returns 0 in this case. Based on the above, maybe Axiom should be changed? William > This is not really a "problem" but does give *interesting* results, when > summing binomials over all integers. For some value of all. > That is, > sum( [ binomial( 3 + i, 2 ) * binomial( 15 - i, 3 ) for i in [-1..12] ] ) > should be the same as > sum( [ binomial( 3 + i, 2 ) * binomial( 15 - i, 3 ) for i in [-14..100] ] ) > > Johann > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---