1

I found an algorithm that enumerates k-subsets of length n/4 for a input set of n length, having a time complexity $O{n\choose n/4}$, the algorithm fits well a problem I'm looking to solve, but I'd like to double check if I understood well its time complexity.

I plotted it for different increasing N and looks exponential (but not as bad as $2^n$ exponential)

As I don't want to do curve fitting... it is possible to simplify that expression in a way that makes possible to get a better sense of what will be its growth?

Raphael
  • 72,336
  • 29
  • 179
  • 389
Jesus Salas
  • 519
  • 1
  • 4
  • 17
  • 1
    Apply the definition of binomial coefficients. – Raphael Nov 01 '17 at 10:19
  • n over k = n! / (k! (n-k)!). Now lookup the Stirling formula. – gnasher729 Nov 01 '17 at 21:57
  • @Raphael after some digging I found that the binary entropy function provides a good result $2^{H(p)n}$ where $p = 1/K$, in the case of $O{n\choose n/4}$ that maps (roughly) to $O(2^{0.811n})$, will you consider (or maybe somebody else) to develop this approach in an answer? I feel like that could be a very good alternative for people looking to know "how fast it grows" other than the Stirling approximation. – Jesus Salas Nov 02 '17 at 19:50
  • I don't think such things are strictly ontopic here. They are probably better off on [math.SE]. (Asymptotics are always borderline.) – Raphael Nov 02 '17 at 20:39

0 Answers0