n:–
Type:–
Result:
–
What is a Factorial?
A factorial (n!) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
A factorial (n!) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
Types of Factorials
- Factorial (n!): Product of all integers from 1 to n
- Double Factorial (n!!): Product of all integers with same parity
- Subfactorial (!n): Number of derangements of n items
Example: To calculate 5!, enter 5
and press "!" or use the preset button.
How to Use the Factorial Calculator
- Enter a number between 0 and 170 in the input field or use the number pad.
- Click "n!" for standard factorial, "n!!" for double factorial, or "!n" for subfactorial.
- Use the preset buttons to quickly calculate common factorial values.
- The calculator shows the result, calculation steps, and handles edge cases.
Note: Due to JavaScript's number precision limits, factorials above 170! will show as "Infinity".
Applications of Factorials
- Permutations: Arranging objects in order (nPr = n!/(n-r)!)
- Combinations: Selecting objects without order (nCr = n!/(r!(n-r)!))
- Probability: Calculating event probabilities
- Series: Taylor and Maclaurin series expansions
- Gamma Function: Extension to non-integers
Factorial Properties
- Base Case: 0! = 1 and 1! = 1
- Recursive: n! = n × (n-1)!
- Growth Rate: Grows faster than exponential
- Stirling's Approximation: n! ≈ √(2πn)(n/e)ⁿ
- Double Factorial: Different parity products
By mathematical convention, 0! = 1. This definition makes many formulas work correctly, particularly in combinatorics where "choosing 0 items from n items" should equal 1 way (choosing nothing).
n! is the product of all integers from 1 to n, while n!! (double factorial) is the product of all integers from 1 to n that have the same parity (odd or even) as n. For example: 6! = 720, but 6!! = 6×4×2 = 48.
Factorials grow extremely quickly. 10! = 3,628,800 and 20! = 2.4×10¹⁸. This calculator can handle up to 170! before reaching JavaScript's number limits. For larger calculations, specialized mathematical software is needed.
Subfactorials (!n) count the number of derangements - arrangements where no element appears in its original position. They're used in probability problems like "hat check problems" where items are randomly redistributed.