I wrote an algorithm that gave a list of words, should check every unique combination of four words in this list of words (regardless of order).
The number of combinations tested xcan be calculated using a binomial coefficient, i.e. x = n!/(r!(n-r)!), where nis the total number of words in the list, and ris the number of words in each combination, which in my case is always 4, so the function x = n!/(4!(n-4)!) = n!/(24(n-4)!). Therefore, since the number of complete words nincreases the number of checked combinations ,,x therefore, increases factorially to the right?
What threw me away was that WolframAlpha was able to rewrite this function as x = (n^4)/24 − (n^3)/4 + (11.n^2)/24 − n/4, so that now it will look polynomial as it grows n? So what is this ?!
Here is a graph to visualize the growth of the function (the letter x switches to l)
source
share