In probability calculations, we frequently need to compute the value of the factorial of some number
n. The factorial of a number
n(designated
n!) is given by the formula
When n is a very large number, this is a time-consuming calculation. Fortunately, there is a handy formula, called Stirling’s Formula, which gives a very good approximation of n! whenever n is large. Stirling’s formula says:
The symbol π is the ratio of a circle’s perimeter to its diameter, and the symbol E is the base of natural logarithms. The actual value of n! is always slightly smaller than the value given by this formula. For this exercise, write a Java code fragment that implements Stirling’s formula.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.