next up previous
Next: Example: Generate and Test Up: CSE 2320: Algorithms and Previous: Logarithms

Factorials

\( n! = \left\{ \begin{array}{ll}
1 & {\rm if} \; n = 0 \\
n*(n-1)! & {\rm if} \; n > 0
\end{array} \right. \)



\(n! \leq n^n\), thus n! = O(nn)



Stirling's Approximation

\begin{displaymath}n! = \sqrt{2 \pi n} (n/e)^n (1 + \Theta(1/n)) \end{displaymath}

Thus,



Copyright © 1998 The University of Texas at Arlington