operation
Factorial Calculator -- n!
Compute n! exactly for any n up to 10,000 using BigInt, with digit count and Stirling approximation.
Beispiel ausprobieren
Wähle ein Szenario, um zu sehen, wie der Rechner funktioniert, und passe dann die Werte an
10! — Arrangements of 10 Items
How many ways can 10 people be seated in 10 chairs?
Wichtige Werte: n = 10 · 10! = 3,628,800
52! — Shuffled Deck of Cards
How many unique orderings exist for a standard 52-card deck?
Wichtige Werte: n = 52 · 52! ≈ 8.07 × 10⁶⁷
What Is a Factorial?
The factorial of a non-negative integer , written , is the product of all positive integers up to :
By convention, . This isn't arbitrary — it ensures that and that the recurrence holds for .
Factorial Values
| n | n! | Digits |
|---|---|---|
| 0 | 1 | 1 |
| 5 | 120 | 3 |
| 10 | 3,628,800 | 7 |
| 15 | 1,307,674,368,000 | 13 |
| 20 | 2,432,902,008,176,640,000 | 19 |
| 52 | ≈ 8.07 × 10⁶⁷ | 68 |
| 100 | ≈ 9.33 × 10¹⁵⁷ | 158 |
Scale: 52! (the number of ways to shuffle a standard deck of cards) is so large that no two truly random shuffles in human history have ever produced the same order.
Stirling's Approximation
For large , computing exactly is impractical. Stirling's formula gives an excellent approximation:
The relative error shrinks as grows — it's already within 1% at and within 0.1% at .
The Gamma Function
The factorial is only defined for non-negative integers. The gamma function extends it to all complex numbers (except non-positive integers):
This gives meaningful values like , which appears in statistics (the normal distribution) and physics.
Frequently Asked Questions
What is a factorial?
The factorial of a non-negative integer , written , is the product of all positive integers from 1 to . For example, . By convention, .
Why does 0! equal 1?
is defined by convention to make mathematical formulas consistent. It ensures that the binomial coefficient (there is exactly one way to choose nothing) and that the recurrence holds when .
How fast does the factorial function grow?
Factorials grow faster than exponential functions. (7 digits), has 19 digits, and (ways to shuffle a deck of cards) has 68 digits. By comparison, is only about 1 million.
What is Stirling's approximation?
Stirling's approximation estimates large factorials: . The relative error is under 1% for and under 0.1% for . It is widely used in statistics and physics where exact factorials are impractical.
Can you compute the factorial of a non-integer?
Yes, using the gamma function: for positive integers, extended to all real numbers except non-positive integers via an integral. For example, , which appears in the normal distribution formula.
Related operation Variants
Explore more operation options
Permutation
Permutation Calculator -- nPr
Combination
Combination Calculator -- nCr
BinomialCoefficient
Binomial Coefficient Calculator -- n Choose k
PascalTriangle
Pascal\'s Triangle Generator
StarsAndBars
Stars and Bars Calculator -- Combinations with Repetition
More Math Calculators
Explore the category