Basecamp
    Home
    Problems
    Contests
    Courses
    Rating
    Posts
    Discord
Binomial coefficient
Sign in
medv
•Article•1 year ago

Binomial coefficient

A combination of n elements taken k at a time is a set of k elements chosen from the given n elements. In this context, sets that differ only in the order of the elements (but not in their composition) are considered identical. It is precisely this property of combinations that distinguishes them from permutations.

For example, consider a set of 5 elements: {1,2,3,4,5}. The sets {2,1,3} and {3,2,1} are identical as combinations (though different as permutations) because they consist of the same elements {1,2,3}.

The formula for calculating the number of combinations of n elements taken k at a time is

Cnk​=k!⋅(n−k)!n!​

The numbers Cnk​ are called binomial coefficients.

Example

Cn0​=1

When we choose zero elements from a set of n elements, we are essentially making an “empty” choice. The empty set, in this context, is considered a valid combination. Imagine you have a box with n balls, and you want to choose 0 of them. Even if you don’t choose anything, it is still a valid choice. Thus, Cn0​ is the number of ways to choose 0 elements from n, which is equal to 1.

We can think of this as the one and only way to not choose any elements from the set, which gives the result of 1.

Cn0​=0!⋅(n−0)!n!​=1!⋅n!n!​=1
Example

Cn1​=n

When we choose one element from a set of n elements, we have n options to choose from: we can choose any one of the n elements. For example, if we have a set of numbers from 1 to 5 ({1,2,3,4,5}), we can choose one number from this set, and we have 5 options for this choice.

The value Cn1​ equals n because there are n ways to choose one element from a set of n elements.

Cn1​=1!⋅(n−1)!n!​=n
Example

Cn2​=2n⋅(n−1)​

When choosing 2 elements from a set of n elements, we form combinations of pairs. To build such a pair, we first choose one element, and then the second.

  • The first element can be chosen from n elements.

  • After choosing the first element, we have n–1 elements left to choose the second element (since we cannot choose the same element again).

Thus, the total number of combinations of pairs of elements that can be chosen from a set of n elements is the product of the number of ways to choose the first and second elements: n⋅(n–1).

However, each pair is counted twice, as the order of elements in the pair does not matter. For example, (p,q) and (q,p) are considered the same pair. To account for this, the total number of combinations should be divided by 2. Therefore, the value Cn2​ equals n⋅(n–1)/2.

Cn2​=2!⋅(n−2)!n!​=2n⋅(n−1)​
Example

Let’s calculate the values of the following binomial coefficients:

C42​=2!⋅2!4!​=23⋅4​=6,
C63​=3!⋅3!6!​=64⋅5⋅6​=20,
C73​=3!⋅4!7!​=65⋅6⋅7​=35

Symmetry rule: Cnk​=Cnn−k​.

The number of ways to choose k elements from n is equal to the number of ways to not choose (n–k) elements from n. There are Cnn−k​ ways to not choose (n–k) elements from n. Therefore Cnk​=Cnn−k​.

Example

Let’s calculate the values of the following binomial coefficients:

C54​=C55−4​=C51​=5,
C64​=C66−4​=C62​=26⋅5​=15

Exercise. Calculate the values of the following binomial coefficients:

1) C52​

3) C54​

5) C81​

2) C83​

4) C75​

6) C85​

Summation formula: Cnk​=Cn−1k−1​+Cn−1k​.

Proof. Let’s calculate the value of the right-hand side of the equation:

Cn−1k−1​+Cn−1k​=(k−1)!⋅(n−k)!(n−1)!​+k!⋅(n−k−1)!(n−1)!​=
k!⋅(n−k)!(n−1)!⋅k+(n−1)!⋅(n−k)​=k!⋅(n−k)!(n−1)!⋅(k+n−k)​=k!⋅(n−k)!n!​=Cnk​
Eolymp #3260: How many?

Preparing for the calculus exam, Petya spread out n different cheat sheets in front of himself. They were his salvation, as throughout the entire semester Petya had never bothered to properly study the material. There were so many cheat sheets that they didn’t fit into any pocket. Therefore, Petya decided to calculate the maximum number of cheat sheets he could take with him to the exam. And then the question arose: how many ways are there in total to choose the required number of cheat sheets?

Input. Contains the total number of cheat sheets n (1≤n≤12) and the number of cheat sheets k (0≤k≤n) that Peter can take with him.

Output. Print the number of ways to choose k cheat sheets from n.

Sample input 1
3 2
Sample output 1
3
Sample input 2
4 1
Sample output 2
4
Open problem
Solution - iterative method

To compute the binomial coefficient, you can use the following formula:

Cnk​=k!⋅(n−k)!n!​=1⋅2⋅3⋅...⋅kn⋅(n−1)⋅(n−2)⋅...⋅(n−k+1)​

Declare a variable res and initialize it with a value of 1. Then multiply res by n and divide the result by 1. After that multiply res by n–1 and divide by 2. Continue this process of multiplication and division k times (the numerator and denominator of Cnk​ after simplification by (n–k)! contain k factors).

Algorithm realization

The Cnk function returns the binomial coefficient using an iterative method.

int Cnk(int n, int k)
{
  int res = 1;
  for(int i = 1; i <= k; i++)
    res = res * (n - i + 1) / i;
  return res;
}
C++
7 lines
125 bytes

The main part of the program. Read the input data.

scanf("%d %d",&n,&k);

Compute and print the answer.

res = Cnk(n,k);
printf("%d\n",res);
Solution - recursive method

For the recursive implementation of the binomial coefficient, use the following formula:

Cnk​={Cn−1k−1​+Cn−1k​,n>01,k=n or k=0​
Algorithm realization - recursive method

The Cnk function returns the binomial coefficient using a recursive method.

int Cnk(int n, int k)
{
  if (n == k) return 1;
  if (k == 0) return 1;
  return Cnk(n - 1, k - 1) + Cnk(n - 1, k);
}

The main part of the program. Read the input data.

scanf("%d %d",&n,&k);

Compute and print the answer.

res = Cnk(n,k);
printf("%d\n",res);
Eolymp #5329. Party

How many ways are there to choose k out of n participants in the summer math camp, each of whom will receive kefir? Print the answer modulo 9929.

Input. Two integers n and k (0≤k≤n≤500).

Output. Print the number of ways modulo 9929.

Sample input
6 3
Sample output
20
Open problem
Solution

The answer to the problem will be the value of Cnk​ mod 9929. Since we need to find the binomial coefficient by modulo, we’ll try to avoid division during calculations. To achieve this, use the relation: Cnk​=Cn−1k​+Cn−1k−1​,Cn0​=1.

Since k≤n≤500, we use the memoization technique.

Algorithm realization

Declare the constants and array cnk, where cnk[n][k]=Cnk​ mod 9929.

#define MAX 510
#define MOD 9929
int cnk[MAX][MAX];

The c function computes the value of the binomial coefficient Cnk​ mod 9929.

int c(int n, int k)
{
  if (cnk[n][k] > 0) return cnk[n][k];
  if (n - k < k) return c(n,n-k);
  if (!k) return cnk[n][k] = 1;
  return cnk[n][k] = (c(n-1,k) + c(n-1,k-1)) % MOD;
}
C++
7 lines
188 bytes

The main part of the program. Initialize the cnk array with zeros. Read the input data.

memset(cnk,0,sizeof(cnk));
scanf("%d %d",&n,&k);

Compute and print the answer.

printf("%d\n",c(n,k));

Binomial coefficients appear in Newton’s binomial:

(x+y)n=k=0∑n​Cnk​xkyn−k

Let’s look at examples:

(x+y)2=C20​x2y0+C21​x1y1+C22​x0y2=x2+2xy+y2,
(x+y)3=C30​x3y0+C31​x2y1+C32​x1y2+C33​x0y3=x3+3x2y+3xy2+y3
Eolymp #9892. C0n + ... + Cnn

Given a non-negative integer n, find the sum of binomial coefficients

Cn0​+Cn1​+...+Cnn​

Input. One non-negative integer n (n≤60).

Output. Print the value of the sum.

Sample input
2
Sample output
4
Open problem
Solution

The formula of the binomial theorem is as follows:

(a+b)n=i=0∑n​Cni​aibn−i

If we set a=b=1, then this relation takes the following form:

(1+1)n=i=0∑n​Cni​1i1n−i

or

2n=i=0∑n​Cni​=Cn0​+Cn1​+...+Cnn​

Thus, the indicated sum equals 2n.

Example

If n=1, then C10​+C11​=1+1=2

If n=2, then C20​+C21​+C22​=1+2+1=4

If n=3, then C30​+C31​+C32​+C33​=1+3+3+1=8

Algorithm realization

Read the input value of n.

scanf("%lld", &n);

Compute and print the result, the value of 2n.

res = 1LL << n;
printf("%lld\n", res);
Eolymp #11271. Sum of squares Cnk

Given a non-negative integer n, find the sum of binomial coefficients

(Cn0​)2+(Cn1​)2+(Cn2​)2+...+(Cnn​)2

Input. One non-negative integer n (n≤30).

Output. Print the value of the sum.

Sample input
3
Sample output
20
Open problem
Solution

Let’s consider 2n objects a1​,...,a2n​ and find the number of ways to select n objects out of 2n.

We’ll divide the set in half: {a1​,a2​,...,an​,an+1​,...,a2n​}. To choose n objects from 2n, we’ll select k (k≤n) objects from the left half (from the set {a1​,a2​,...,an​}) and n–k objects from the right half (from the set {an+1​,an+2​,...,a2n​}). The number of ways to make such a selection, according to the rule of multiplication, is equal to Cnk​⋅Cnn−k​=(Cnk​)2. Since k can take values from 0 to n, то ∑k=0n​(Cnk​)2 is equal to the number of ways to choose n objects from 2n, which is equal to C2nn​. Thus,

(Cn0​)2+(Cn1​)2+(Cn2​)2+...+(Cnn​)2=C2nn​

Example

For n=3 the answer is (C30​)2+(C31​)2+(C32​)2+(C33​)2=12+32+32+12=20

At the same time C63​=3!⋅3!6!​=64⋅5⋅6​=20.

Algorithm realization

The Cnk function computes the value of the binomial coefficient Cnk​.

long long Cnk(long long n, long long k)
{
  long long res = 1;
  if (k > n - k) k = n - k;
  for (long long i = 1; i <= k; i++)
    res = res * (n - i + 1) / i;
  return res;
}
C++
8 lines
185 bytes

The main part of the program. Read the value of n.

scanf("%lld", &n);

Compute and print the answer.

res = Cnk(2*n, n);
printf("%lld\n", res);
Eolymp #11550. x1 + x2 + ... + xk = n

Given the values of k and n, find the number of positive integral solutions for the equation

x1​+x2​+...+xk​=n

Input. Two positive integers k and n (k≤n≤100).

Output. Print the number of positive integral solutions for the given equation. It is known that the answer is no more than 1018.

Sample input
3 4
Sample output
3
Open problem
Solution

Consider a sequence of n ones: 111...11. You can insert a ‘+’ sign between any two ones. For example, 11+111+1. Such notation denotes the sum 2+3+1, where each term represents the number of ones adjacent to each other. The number of positions where a ‘+’ sign can be inserted is n–1. Since the sum must consist of k terms, k–1 ‘+’ signs should be inserted.

We should insert k–1 pluses in n–1 places. This can be done in Cn−1k−1​ ways.

Example

Consider the equation x1​+x2​+x3​=4. It has 3 positive integer solutions:

  • (1,1,2)

  • (1,2,1)

  • (2,1,1)

For example, n=4 ones can be divided into k=3 terms in C23​=3 ways:

Algorithm realization

The Cnk function computes the value of the binomial coefficient Cnk​.

long long Cnk(long long k, long long n)
{
  long long res = 1;
  if (k > n - k) k = n - k;
  for (long long i = 1; i <= k; i++)
    res = res * (n - i + 1) / i;
  return res;
}
C++
8 lines
185 bytes

The main part of the program. Read the input data.

scanf("%lld %lld", &k, &n);

Compute and print the answer — the value of Cn−1k−1​.

res = Cnk(k - 1, n - 1);
printf("%lld\n", res);
Eolymp #11551. x1+...+xk = n (2)

Given values of k and n, find the number of nonnegative integral solutions for the equation

x1​+x2​+...+xk​=n

Input. Two positive integers k and n (k≤n≤100).

Output. Print the number of nonnegative integral solutions for the given equation. It is known that the answer is no more than 1018.

Sample input
3 4
Sample output
15
Open problem
Solution

Consider a sequence of n+k–1 positions. In n positions we should place 1. In k–1 positions we should place the '+' symbol (to obtain k terms).

Any arrangement of 1s and '+' signs among these positions will correspond to some solution of the given equation. For example, consider some solutions of the equation x1​+x2​+x3​=4(4 ones and 2 plus signs):

We should insert k–1 plus signs into n+k–1 positions. This can be done in Cn+k−1k−1​ ways.

Example

Consider the equation x1​+x2​+x3​=4. Its solutions are:

  • (4,0,0) and its 3 permutations;

  • (3,1,0) and its 6 permutations;

  • (2,2,0) and its 3 permutations;

  • (2,1,1) and its 3 permutations;

There are 3+6+3+3=15 solutions.

Algorithm realization

The Cnk function computes the value of the binomial coefficient Cnk​.

long long Cnk(long long k, long long n)
{
  long long res = 1;
  if (k > n - k) k = n - k;
  for (long long i = 1; i <= k; i++)
    res = res * (n - i + 1) / i;
  return res;
}
C++
8 lines
185 bytes

The main part of the program. Read the input data.

scanf("%lld %lld", &k, &n);

Compute and print the answer — the value of Cn+k−1k−1​.

res = Cnk(k - 1, n + k - 1); 
printf("%lld\n", res);
Eolymp #318. Binomial coefficients 1

Let n be a non-negative integer. Let

n!=1⋅2⋅...⋅n (0!=1),
Cnk​=k!⋅(n−k)!n!​(0≤k≤n)

You are given the numbers n and k. Calculate Cnk​.

Input. The first line contains the number of test cases t (t≤50). Each of the next t lines contains two integers n and k (0≤n<264,0≤Cnk​<264).

Output. Print t lines, each contains the value Cnk​ for corresponding test.

Sample input
6
0 0
1 0
1 1
2 0
2 1
2 2
7 lines
33 bytes
Sample output
1
1
1
1
2
1
Open problem
Solution

Computations will be performed using 64-bit unsigned integers (unsigned long long). Its obvious that

Cnk​=k!⋅(n−k)!n!​=1⋅2⋅3⋅...⋅kn⋅(n−1)⋅(n−2)⋅...⋅(n−k+1)​=1n​⋅2n−1​⋅3n−2​⋅...⋅kn−k+1​

Let’s assign the value of the variable res to 1. Then multiply it by in−i+1​ for all i from 1 to k. Each time the division by i will yield an integer result, but multiplication can cause overflow. Let d=GCD(res,i). Then let’s rewrite the operation

res=res∗(n–i+1)/i

as

res=(res/d)∗((n–i+1)/(i/d))

In this implementation we’ll avoid overflow (the answer is 64-bit unsigned integer). Note that first we need to perform the division (n–i+1)/(i/d), and then multiply res/d by the resulting quotient.

To compute Cnk​, we must run k iterations. But what to do if we want to compute C20000000001999999999​? The answer is no more than 264, so such input values are possible. As long as Cnk​=Cnn−k​, then for n–k<k we should assign k=n–k.

Example

Consider the next sample:

C63​=16​⋅25​⋅34​=15⋅34​

Let res=15, and we need to make a multiplication res⋅34​=15∗34​. Compute d=GCD(15,3)=3. So 15⋅34​=(15/3)⋅3/34​=5⋅14​=20.

Algorithm realization

The gcd function computes the greatest common divisor of a and b.

unsigned long long gcd(unsigned long long a, unsigned long long b)
{
  return (!b) ? a : gcd(b,a % b);
}

The Cnk function computes the value of the binomial coefficient Cnk​.

unsigned long long Cnk(unsigned long long n, unsigned long long k)
{
  unsigned long long CnkRes = 1, t, i;
  if (k > n - k) k = n - k;
  for(i = 1; i <= k; i++)
  {
    t = gcd(CnkRes, i);
    CnkRes = (CnkRes / t) * ((n - i + 1) / (i / t));
  }
  return CnkRes;
}
C++
11 lines
277 bytes

The main part of the program. Read the input data. Sequentially process the test cases.

scanf("%d",&t);
while(t--)
{
  scanf("%llu %llu",&n,&k);
  res = Cnk(n,k);
  printf("%llu\n",res);
}
C++
7 lines
108 bytes
Eolymp #11488. Binomial sum

Given a positive integer n. Find the value of the next sum

1⋅Cn0​+2⋅Cn1​+3⋅Cn2​+...+(n+1)⋅Cnn​

Input. One positive integer n (n≤30).

Output. Print the sum value.

Sample input
3
Sample output
20
Open problem
Solution

Rewrite the sum in the form:

1⋅Cn0​+2⋅Cn1​+3⋅Cn2​+...+(n+1)⋅Cnn​=
(Cn0​+Cn1​+Cn2​+...+Cnn​)+1⋅Cn1​+2⋅Cn2​+...+n⋅Cnn​

The sum in parentheses is 2n. If in Newton’s binomial formula

(a+b)n=i=0∑n​Cni​aibn−i

we set a=b=1, then we get the relation: (1+1)n=∑i=0n​Cni​1i1n−i, or

2n=i=0∑n​Cni​=Cn0​+Cn1​+...+Cnn​

Let’s compute the remaining sum:

1⋅Cn1​+2⋅Cn2​+...+n⋅Cnn​=
1⋅1!⋅(n−1)!n!​+2⋅2!⋅(n−2)!n!​+...+n⋅n!⋅(n−n)!n!​=
n⋅(0!⋅(n−1)!(n−1)!​+1!⋅(n−2)!(n−1)!​+...+(n−1)!⋅(n−n)!(n−1)!​)=
n⋅(Cn−10​+Cn−11​+...+Cn−1n−1​)=n⋅2n−1

So the answer is 2n+n⋅2n−1=(n+2)⋅2n−1.

Example

Compute the value for n=3. For direct calculation:

1⋅C30​+2⋅C31​+3⋅C32​+4⋅C33​=1⋅1+2⋅3+3⋅3+4⋅1=1+6+9+4=20

When calculated using the formula: 5⋅22=20.

Algorithm realization

Read the input value of n.

scanf("%lld", &n);

Compute and print the answer.

res = (1LL << (n - 1)) * (n + 2);
printf("%lld\n", res);

Algorithm realization – function

Declare an array to store the results: dp[n][k]=Cnk​.

int dp[31][31];

The Cnk function computes the value of the binomial coefficient Cnk​.

int Cnk(int n, int k)
{
  if (n == k) return 1;
  if (k == 0) return 1;
  if (dp[n][k] != -1) return dp[n][k];
  return dp[n][k] = (Cnk(n - 1, k - 1) + Cnk(n - 1, k)) % 9929;
}
C++
7 lines
184 bytes

The main part of the program. Read the input value of n.

scanf("%d", &n);
memset(dp, -1, sizeof(dp));

Compute the required sum.

res = 0;
for (i = 0; i <= n; i++)
  res += (i + 1) * Cnk(n, i);

Print the answer.

printf("%d\n", res);
Eolymp #10668. Paths on a grid

You have a piece of paper and you choose a rectangle of size n⋅m on it. Let’s call this rectangle together with the lines it contains a grid. Starting at the lower left corner of the grid, you move your pencil to the upper right corner, taking care that it stays on the lines and moves only to the right or up. The result is shown on the left:

Really a masterpiece, isn’t it? Repeating the procedure one more time, you arrive with the picture shown on the right. Now you wonder: how many different works of art can you produce?

Input. Two positive integers n and m.

Output. Print the number of different art works that can be generated using the procedure described above. You may safely assume that this number fits into a 64-bit signed integer.

Sample input 1
3 4
Sample output 1
35
Sample input 2
1 1
Sample output 2
2
Open problem
Solution

The required path is a broken line consisting of n+m links. Of these, n links must be vertical, and the rest must be horizontal. The number of ways to choose n vertical links out n+m is equal to Cn+mn​.

Example

For the first test case n=3,m=4. The answer is C73​=3!⋅4!7!​=1⋅2⋅37⋅6⋅5​=35.

For the second test case n=1,m=1. The answer is C21​=1!⋅1!2!​=2.

Algorithm realization

The Cnk function computes the value of the binomial coefficient Cnk​.

long long Cnk(long long n, long long k)
{
  long long res = 1;
  if (k > n - k) k = n - k;
  for (long long i = 1; i <= k; i++)
    res = res * (n - i + 1) / i;
  return res;
}
C++
8 lines
185 bytes

The main part of the program. Read the input data.

scanf("%lld %lld", &n, &m);

Compute and print the answer Cn+mn​.

res = Cnk(n + m, n);
printf("%lld\n", res);
Eolymp #4008. Binomial coefficients

Gunnar is quite an elderly and forgetful researcher. Currently, he is writing a paper on security in social networks that involves some combinatorics. He developed a program to calculate binomial coefficients to assist him in verifying some of his calculations.

The binomial coefficient Cnk​ is a number defined by

Cnk​=k!⋅(n−k)!n!​

where n and k are non-negative integers.

Gunnar uses his program to calculate Cnk​ and obtains a number m as a result. Unfortunately, being forgetful, he forgot the numbers of n and k he used as input. These two numbers were the result of lengthy computations and were written on one of the many sheets scattered across his desk. Instead of searching through the papers, he decided to reconstruct the numbers n and k from the obtained answer. Can you help him find all possible values?

Input. The first line contains the number of test cases, at most 100. Each test is given in a single line and contains an integer m (2≤m≤1015) — the result of the Gunnar’s program.

Output. For each test, print two lines. The first line should contain the number of ways to express m using the binomial coefficient. The second line should contain all pairs (n,k) such that Cnk​=m. Pairs should be sorted in increasing order of n, and in case of equality, in increasing order of k. The output format of pairs is given in the example.

Sample input
2
2
15
Sample output
1
(2,1) 
4
(6,2) (6,4) (15,1) (15,14)
Open problem
Solution

If Cnk​=m, then Cnn−k​=m. It is sufficient to find the solution for k≤n/2 and, along with the pair (k,n), also print the pair (k,n–k). For k=n/2 these two pairs coincide.

Let p be the smallest number for which C2pp​>m. Then it is obvious that 0≤k<p.

Choose k such that C2kk​≤m and consider the function f(n)=Cnk​. Then for 2k≤n≤m, the function f(n) is monotonically increasing. Therefore, you can solve the equation f(n)=m by binary search.

To solve the problem, one should iterate over the values of k (0≤k<p), and for each such k, solve the equation Cnk​=m relatively n with binary search. The found value of n must be an integer.

Example

Consider the equation Cnk​=3003. Given that C126​=924 and C147​=3432, it is sufficient to iterate over 0≤k≤6.

Let k=2, consider the equation Cn2​=3003 or 2n⋅(n−1)​=3003, n⋅(n–1)=6006. By binary search in the interval 4≤n≤3003, we find an integer solution n=78. Since n=2⋅k, we have two solutions: C782​=C7876​=3003.

Algorithm realization

Store the required pairs in the vector of pairs res.

vector<pair<long long,long long> > res;

The Cnk function computes the value of binomial coefficient Cnk​.

long long Cnk(long long n, long long k)
{
  long long i, Res = 1;
  if (k > n - k) k = n - k;
  for(i = 1; i <= k; i++)
  {

If at the next iteration the result exceeds m (we are searching for a solution to the equation Cnk​=m), then stop computations. Exiting the function at this point avoids overflow.

    if (1.0 * Res * (n - i + 1) / i > m) return m + 1;
    Res = Res * (n - i + 1) / i;
  }
  return Res;
}

The main part of the program. Read the input data.

scanf("%d",&tests);
while (tests--) 
{
  res.clear();
  scanf("%lld",&m);

Iterate over the values of k from 0 until C2kk​≤m.

  for(k = 0; Cnk(2*k,k) <= m; k++)
  {

Find the value of n (2k≤n≤m) using binary search.

    long long lo = 2*k, hi = m;
    while (lo < hi) 
    {
      long long n = (lo + hi) / 2;
      if (Cnk(n,k) < m) lo = n + 1; else hi = n;
    }

If Clok​=m, then a solution is found. Include one or two pairs of solutions in the result.

    if (Cnk(lo,k) == m)
    {
      res.push_back(make_pair(lo,k));
      if (lo != 2*k)
        res.push_back(make_pair(lo,lo - k));
    }
  }
C++
7 lines
151 bytes

Sort the pairs.

  sort(res.begin(),res.end());

Print the answer — the number of found pairs and the pairs themselves.

  printf("%d\n",res.size());
  for(i = 0; i < res.size(); i++)
    printf("(%lld,%lld) ", res[i].first,res[i].second);
  printf("\n");
}

Asymptotic nonations for the Binomial Coefficients

Theorem 1. There exists a relationship between the binomial coefficients:

Cn0​<Cn1​<...<Cn⌊n/2⌋​≥Cn⌊n/2⌋+1​>...>Cnn​

Theorem 2. C2nn​<4n. Follows from the fact that ∑k=02n​C2nk​=(1+1)2n=22n=4n

Theorem 3. C2nn​>2n+14n​. Follows from the fact that ∑k=02n​C2nk​=4n, and the number of coefficients is 2n+1. Therefore, the largest of the coefficients will be greater than 2n+14n​.

Theorem 4. Stirling formula. n!≈2πn​(en​)n.

A more accurate approximation is:

n!≈2πn​(en​)n(1+12n1​+288n21​−51849n3139​−2488320n4571​)

Theorem 5.

C2nn​≈(2πn​(en​)n)24πn​(e2n​)2n​=πn​4n​

Theorem 6.

Cnk​=k!(n−k)!n!​=1⋅2⋅3⋅...⋅kn⋅(n−1)⋅(n−2)⋅...⋅(n−k+1)​=
k!n!​⋅(1−n1​)⋅(1−n2​)⋅...⋅(1−nk−1​)=
k!n!​⋅eln(1−n1​)+ln(1−n2​)+...+ln(1−nk−1​)≤(use the inequality ln(1−x)≤−x)
k!n!​⋅e−n1​−n2​−...−nk−1​=k!n!​⋅e−2nk⋅(k−1)​

List of problems

  • 318. Binomial coefficients 1

  • 3260. How many?

  • 4008. Binomial coefficients

  • 5329. Party

  • 9892. C0n + … + Cnn

  • 10668. Paths on a grid

  • 11271. Sum of squares Cnk

  • 11550. x1 + … + xk = n

  • 11551. x1 + … + xk = n (2)

  • 11488. Binomial sum


37

Comments

Loading

Just a moment, getting data from the server

Nothing yet

Be the first one to start the conversation!
Sign in