Top
Back: absValue
Forward: deleteSublist
FastBack: compregb_lib
FastForward: inout_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.4 binomial

Procedure from library general.lib (see general_lib).

Usage:
binomial(n,k); n,k integers

Return:
binomial(n,k); binomial coefficient n choose k
- of type bigint (computed in characteristic 0)

Note:
In any characteristic, binomial(n,k) = coefficient of x^k in (1+x)^n

Example:
 
LIB "general.lib";
binomial(200,100);"";                 //type bigint
int n,k = 200,100;
bigint b1 = binomial(n,k);
ring r = 0,x,dp;
poly b2 = coeffs((x+1)^n,x)[k+1,1];  //coefficient of x^k in (x+1)^n
b1-b2;                               //b1 and b2 should coincide
See also: prime.


Top Back: absValue Forward: deleteSublist FastBack: compregb_lib FastForward: inout_lib Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-0, Mar 2009, generated by texi2html.