12

Is it a valid to say $$ {n \choose k} = \Theta \left( n^k \right) $$ for any $n$ and $k$? If so, how to prove it?

Note: $k$ is not a function of $n$.

Note: Observed it here (page 5): http://www.cs.berkeley.edu/~sinclair/cs271/n6.pdf

enter image description here

Daniel
  • 2,630
  • 1
    Only as long as $k$ is a constant which does not depend on $n$ -- otherwise, it could be false. – Clement C. May 03 '15 at 23:46
  • Thanks. Let's assume that it is fixed. I added to the question. Could you give hints on the proof? – Daniel May 03 '15 at 23:47
  • 5
    It is quite easy to show that for fixed $k$, we have $\lim_{n\to\infty}\frac{\binom{n}{k}}{n^k}=\frac{1}{k!}$. – André Nicolas May 03 '15 at 23:53
  • At first I was wondering what the capital omega function was, and then I facepalmed when I realized from the answers that it was "Big Oh" notation from CS. Then I double facepalmed as if coming across Homer's Odyssey in Ελληνική and then discovering "oh, this is a Greek translation of the original English poem." – SO_fix_the_vote_sorting_bug Feb 13 '22 at 09:27

3 Answers3

18

You have that $$ \binom{n}{k} = \frac{n!}{(n-k)!k!} = \frac{1}{k!}\frac{n!}{(n-k)!} = \frac{1}{k!}\left(n(n-1)(n-2)\dots(n-k+1)\right). $$ As far as the $\Theta(\cdot)$ notation is concerned, $k$ is a constant, so $\frac{1}{k!}=\Theta(1)$, and $$ \left(n(n-1)(n-2)\dots(n-k+1)\right) = n^k\cdot\left(1\left(1-\frac1n\right)\left(1-\frac2n\right)\dots\left(1-\frac kn\right)\right) $$ and as $k$ is fixed,, $$ \left(1\left(1-\frac1n\right)\left(1-\frac2n\right)\dots\left(1-\frac kn\right)\right) \xrightarrow[n\to\infty]{} 1 $$ so that indeed $$ \binom{n}{k} = \Theta(n^k) $$

Clement C.
  • 67,323
  • But is $n \choose n/2$ $ \sim n^{n/2} \sim \exp(n/2 \log n)$ polynomial? – Peter Leopold Mar 19 '23 at 17:07
  • 1
    @PeterLeopold The approximation only holds for constant $k$, and breaks for $k=k(n)$ (as in your example). For instance, $\binom{n}{n/2} = \Theta(2^{n/2}/\sqrt{n})$. (There are various proofs of this, some using Sitrling's approximation, some others using a probabilistic interpretation.) – Clement C. Mar 19 '23 at 20:34
  • Your logic is partially correct, and you're on the right track, but there's a small error in your reasoning. Please take a look at my answer below. – A.Gh Nov 04 '23 at 05:56
  • The question is about the value of the binomial coefficient, not the time complexity to compute it. Your answer is not answering the question. – Clement C. Nov 04 '23 at 19:39
4

We can even make a stronger statement that $${n \choose k} = O\left (\left( \frac{e \cdot n}{k} \right)^k \right)$$ For the proof, see this.

IY3
  • 92
-1

The time complexity of calculating the binomial coefficient C(n, k) can be expressed in different ways, depending on the algorithm used. The most common methods to calculate C(n, k) include:

  1. Direct Calculation: The straightforward method is to use the binomial coefficient formula:

    C(n, k) = n! / (k! * (n - k)!),

Calculating factorials has a time complexity of O(n), so the time complexity for calculating C(n, k) using this formula is O(n) (or Θ(n)).

  1. Dynamic Programming: Another common approach is to use dynamic programming to calculate C(n, k) more efficiently. This is typically done using a 2D array to store intermediate results and has a time complexity of O(n * k) (or Θ(n*k)).

  2. Pascal's Triangle: If you have precomputed Pascal's triangle or a memoization table, you can look up the value of C(n, k) in constant time. Building Pascal's triangle requires O(n^2) time, but once it's constructed, accessing values is O(1).

So, the time complexity of C(n, k) depends on the method you choose.

A short message to Clement C and IY3:

In the context of the binomial coefficient (n choose k), it is indeed correct to say that (n choose k) is Θ(n^k). The reason for this is that (n choose k) is a polynomial function of degree k in n. In Big O notation (Θ notation), we look for upper bounds or tight bounds on the growth of a function. In this case, the growth of (n choose k) is proportional to n^k, so we can represent it as Θ(n^k).

Your initial logic is valid, but you made it more complicated than it needed to be. (n choose k) is indeed Θ(n^k) because it's a polynomial function of n with degree k. The constants involved in k! and other terms do not change the overall polynomial nature of the function. But as I mentioned above, it can be of Θ(n) or Θ(n*k).

A.Gh
  • 99
  • 2
    What part are you saying is wrong about the other answer? They said that that product tends to $1$, not $0$. – Varun Vejalla Nov 04 '23 at 06:30
  • Thanks Varun, I edited my answer. – A.Gh Nov 04 '23 at 06:32
  • Just an important note: Dynamic programming is usually faster than direct computation for calculating binomial coefficients (C(n, k)) because it avoids the need to repeatedly compute factorials, which can be time-consuming for large n and k. Although dynamic programming has a theoretically higher time complexity (O(n * k)) compared to direct computation (O(n)), it's more efficient in practice, especially for larger n and k, due to the avoidance of expensive factorial calculations. So dynamic programming is a preferred method for calculating C(n,k) in most cases. – A.Gh Nov 04 '23 at 06:42
  • The question is about the value of the binomial coefficient, not the time complexity to compute it. Your answer is not answering the question. – Clement C. Nov 04 '23 at 19:38