‹ BackHN Continuity

Thread

How big are factorials?

99 points · 43 comments · ibobev

  1. abetusk · · focus · HN ↗
    lg(n!) grows roughly as (n lg n). Constants matter, of course, but to that's the rough estimate.

    As an aside, if you take numbers from 0 to (n-1) in an array, there are n! configurations, so representing each configuration or differentiating each configuration take n lg n bits. So, in some sense, taking a mapping that's able to differentiate the input state to map to the ordered state takes at least O(n lg n) time, the standard runtime of a basic sorting algorithm.

    Any additional assumptions (n larger than maximum element, distribution of elements) helps reduce this.

    1. [deleted] · · focus · HN ↗

      [deleted]

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.