Doing Math With JavaScript

Binomial Coefficients Calculator
With Arbitrary Precision Arithmetic

  Doing Math with JavaScript
Input n, k (0 ≤ kn ≤ 50000)  Result: C(n,k)   (to select: click, Ctrl+A, Ctrl+C) Run time:
n =   k =
 
n =   k =
 
n =   k =
 
n =   k =
 
n =   k =
 

The binomial coefficient C(n,k) is defined as the number of different ways to choose a k-element subset from an n-element set. The values C(n,k) appear in Pascal's triangle and satisfy the recurrence

C(n,k)  =  C(n − 1, k − 1)  +  C(n − 1, k).

Equivalently, C(n,k) is the coefficient of the akbn−k term in the full expansion of the binomial power (a + b)n. Note that in the expression (a + b)n the variables a and b appear in a symmetric manner; therefore, we have C(n,k) = C(n, n−k) for any kn. For example, the expansion

(a + b)4  =  a4 + 4a3b + 6a2b2 + 4ab3 + b4
yields the following binomial coefficients:
C(4,0) = 1,   C(4,1) = 4,   C(4,2) = 6,   C(4,3) = 4,   C(4,4) = 1.

This online calculator computes binomial coefficients C(n,k) for input values 0 ≤ kn ≤ 50000 in arbitrary precision arithmetic. So, for instance, you will get all digits of C(9000,4500) – all the 2708 digits of this very large number!

See also:
• 100+ digit calculator: arbitrary precision arithmetic
• Prime factorization calculator
• Euler's totient function φ calculator
• Highly composite numbers
• Divisors and sum-of-divisors calculator
• Fibonacci numbers calculator
• Catalan numbers calculator

Doing Math with JavaScript. Copyright © 1999-2015, JavaScripter.net.