Following are common definition of Binomial Coefficients.
- A binomial coefficient C(n, k) can be defined as the coefficient of X^k in the expansion of (1 + X)^n.
- A binomial coefficient C(n, k) also gives the number of ways, disregarding order, that k objects can be chosen from among n objects; more formally, the number of k-element subsets (or k-combinations) of an n-element set.
Given two numbers n and r, find value of nCr
Input : n = 5, r = 2 Output : 10 The value of 5C2 is 10 Input : n = 3, r = 1 Output : 3
The idea is simply based on below formula.
nCr = (n!) / (r! * (n-r)!)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to calculate the value of nCr Efficiently
- Calculate nCr using Pascal's Triangle
- Find a pair from the given array with maximum nCr value
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Compute nCr % p | Set 1 (Introduction and Dynamic Programming Solution)
- Compute nCr % p | Set 2 (Lucas Theorem)
- Sum of product of r and rth Binomial Coefficient (r * nCr)
- Queries of nCr%p in O(1) time complexity
- Find if nCr is divisible by the given prime
- Compute nCr % p | Set 3 (Using Fermat Little Theorem)
- C program to calculate the value of nPr
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Program to calculate the value of nPr
- Calculate the Discriminant Value
- Find minimum number of Log value needed to calculate Log upto N
- Write a program to calculate pow(x,n)
- Efficient program to calculate e^x
- Program to calculate the number of odd days in given number of years
- Program to Calculate Body Mass Index (BMI)
- Program to calculate distance between two points
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.