Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the growth of the binomial coefficient function factorial or polynomial

I have written an algorithm that given a list of words, must check each unique combination of four words in that list of words (regardless of order).

The number of combinations to be checked, x, can be calculated using the binomial coefficient i.e. x = n!/(r!(n-r)!) where n is the total number of words in the list and r is the number of words in each combination, which in my case is always 4, therefore the function is x = n!/(4!(n-4)!) = n!/(24(n-4)!). Therefore as the number of total words, n, increases the number of combinations to be checked, x, therefore increases factorially right?

What has thrown me is that WolframAlpha was able to rewrite this function as x = (n^4)/24 − (n^3)/4 + (11.n^2)/24 − n/4, so now it would appear to grow polynomially as n grows? So which is it?!

Here is a graph to visualise the growth of the function (the letter x is switched to an l)

like image 277
Tyler Bevan Avatar asked Apr 17 '16 23:04

Tyler Bevan


People also ask

Is binomial A polynomial coefficient?

Binomial coefficients as polynomials As such, it can be evaluated at any real or complex number t to define binomial coefficients with such first arguments. These "generalized binomial coefficients" appear in Newton's generalized binomial theorem.

What is the coefficient of binomial expansion?

Properties of Binomial Theorem The number of coefficients in the binomial expansion of (x + y)n is equal to (n + 1). There are (n+1) terms in the expansion of (x+y)n. The first and the last terms are xn and yn respectively.

What does the binomial coefficient represent?

A binomial coefficient equals the number of combinations of r items that can be selected from a set of n items. It also represents an entry in Pascal's triangle. These numbers are called binomial coefficients because they are coefficients in the binomial theorem.


1 Answers

For a fixed value of r, this function is O(n^r). In your case, r = 4, it is O(n^4). This is because most of the terms in the numerator are canceled out by the denominator:

n!/(4!(n-4)!) 
   = n(n-1)(n-2)(n-3)(n-4)(n-5)(n-6)...(3)(2)(1) 
     -------------------------------------------
     4!(n-4)(n-5)(n-6)...(3)(2)(1)

   = n(n-1)(n-2)(n-3)
     ----------------
           4!

This is a 4th degree polynomial in n.

like image 200
Jeremy West Avatar answered Sep 28 '22 08:09

Jeremy West