Factorial Formula:
From: | To: |
The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. By definition, 0! = 1. Factorials grow very rapidly with increasing n.
The calculator uses the factorial definition:
Where:
Explanation: The calculator computes the product of all positive integers from 1 to n. For n=0, it returns 1 by definition.
Details: Factorials are fundamental in combinatorics, probability theory, algebra, and mathematical analysis. They appear in permutations, combinations, Taylor series, and more.
Tips: Enter any integer between 0 and 170. The limit is 170 because 171! exceeds PHP's maximum float size. Results are formatted with thousand separators for readability.
Q1: Why is 0! equal to 1?
A: This is by definition to maintain consistency in combinatorial formulas and the empty product concept.
Q2: Can factorials be calculated for negative numbers?
A: No, standard factorial is only defined for non-negative integers. For negative numbers, see Gamma function.
Q3: Why is there a limit of 170?
A: 171! ≈ 1.24×10³⁰⁹ exceeds PHP's floating point maximum. Higher values would require arbitrary-precision arithmetic.
Q4: How are factorials used in probability?
A: They're essential in permutation and combination calculations which form the basis of many probability problems.
Q5: What's the fastest way to compute large factorials?
A: For very large n, approximation methods like Stirling's formula are used: \( n! \approx \sqrt{2\pi n}(\frac{n}{e})^n \).