Stirling’s approximation formula

Posted on September 22, 2007

I don’t know what Stirling was drinking but this is just beautiful!

Filed Under Uncategorized |

9 Comments so far
  1. 00strange September 23, 2007 11:08 am

    CRAZY SH*T MAN!!

    Woow

    hold it, does this mean its faster to calculate n! by this approximation? instead of recursion or w/e?

  2. elendal September 23, 2007 12:57 pm

    Yes, for large values of n, you can get n! in constant time O(1).

  3. 00strange September 23, 2007 5:34 pm

    That is just amazing…
    this is amazing…. wtf, does this mean, by any chance, that there might be such solutions (approximations) for other recursive calculations?
    lets say, fabonati…(i cant come up with any other one off the top of my head)

  4. elendal September 23, 2007 5:59 pm

    I remember in one of our classes we converting sequences to functions that took n^th element of the sequence and computed the value without recursion.
    But I need to check the book.

    I’m not sure if any such problem can be solved in a constant time, but I’m pretty sure that any recursive algorithm can be computer iteratively (in a loop).

  5. 00strange September 25, 2007 8:22 am

    But loops, as recursion, take none constant time.

  6. elendal September 25, 2007 9:23 am

    In practical situations when program requires some long computations, it’s possible to precompute the all or some results on the working interval,

    For example every n^th value, so that you can compute any m^th > n^th starting from n^th (not from 0) thus saving some time.

    Althought it does not metter it theory, in practice we often work within reasonable small numeric interval.

  7. 00strange September 25, 2007 9:27 am

    i see

  8. elendal September 25, 2007 9:33 am

    I remember, once I saw a CD-ROM full of precomputed integers, it was used for some physics simulator.

  9. 00strange September 25, 2007 11:15 am

    Oh nice man, i didnt know they’d do that!

    Good idea indeed!

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name

Email

Website

Comments

For spam detection purposes, please copy the number 4697 to the field below:

© Copyright 0xDEADBEEFCAFE • Powered by Wordpress • Design by Sebastin.

free web hit counter