Binomial Coefficient
The majority content in the following can be found in wikipedia https://en.wikipedia.org/wiki/Binomial_coefficient. Here I would like to highlight some key “basics” concisely.
Definition
Recursive Formula (Pascal’s rule)
Multiplicative Formula
Factorial Formula
Pascal’s Triangle (杨辉三角)
0: 1
1: 1 1
2: 1 2 1
3: 1 3 3 1
4: 1 4 6 4 1
5: 1 5 10 10 5 1
6: 1 6 15 20 15 6 1
7: 1 7 21 35 35 21 7 1
8: 1 8 28 56 70 56 28 8 1
Row number contains the numbers for . It is constructed by starting with ones at the outside and then always adding two adjacent numbers and writing the sum directly underneath. This method allows the quick calculation of binomial coefficients without the need for fractions or multiplications.
Compute Binomial Coefficient via Programming Languages
- Using Recursive Formula
- Recursive implementation
- Iterative implementation (DP) http://www.brpreiss.com/books/opus5/html/page460.html
- Using Multiplicative Formula
- Using Factorial Formula