Factorial: n! = nร(nโ1)ร...ร1
n! is the product of all positive integers from 1 to n. 0! = 1 by convention. Used in permutations (n!), combinations (n!/(k!(nโk)!)), and probability. Stirling approximation for large n.
Did our AI summary help? Let us know.
n! grows very fast: 10! = 3,628,800. Permutations of n objects = n!. Stirling: n! ~ โ(2ฯn)(n/e)^n as nโโ.
Ready to run the numbers?
Why: Factorial counts arrangements: n! ways to order n distinct items. Appears in permutations, combinations, Taylor series (e^x), and probability (binomial).
How: Multiply 1ร2ร3ร...รn. For large n, use Stirling: n! โ โ(2ฯn)(n/e)^n. 0! = 1. Negative factorial is undefined.
Run the calculator when you are ready.
Factorial Growth
Result Magnitude
๐ Step-by-Step Breakdown
For educational and informational purposes only. Verify with a qualified professional.
๐งฎ Fascinating Math Facts
0! = 1 by convention. n! = n ร (nโ1)!.
Permutations: P(n,r) = n!/(nโr)!.
๐ Key Takeaways
- โข n! = n ร (n-1) ร ... ร 1. By convention, 0! = 1 and 1! = 1
- โข Factorials grow extremely fast: 10! โ 3.6 million, 70! exceeds 10^100
- โข Double factorial n!! multiplies every 2nd number down to 1 or 2
- โข Subfactorial !n counts derangements (permutations with no fixed points)
- โข Stirling's approximation: n! โ โ(2ฯn) ร (n/e)^n โ accurate for large n
๐ก Did You Know?
๐ How It Works
n! is the product of all positive integers from 1 to n. By definition, 0! = 1 (empty product). For large n, we use BigInt for exact values up to 170!. Stirling's approximation gives estimates for n > 100.
๐ Worked Example: 5!
Expand: 5! = 5 ร 4 ร 3 ร 2 ร 1
Step 1: 5 ร 4 = 20
Step 2: 20 ร 3 = 60
Step 3: 60 ร 2 = 120
Result: 5! = 120
Interpretation: 120 ways to arrange 5 distinct objects.
๐ Real-World Applications
๐ฒ Permutations
Ways to arrange n distinct objects: n!
๐ข Combinations
C(n,k) = n!/(k!(n-k)!)
๐ Probability
Counting arrangements in probability.
๐ฌ Taylor Series
e^x = ฮฃ x^n/n!
๐ Combinatorics
Counting problems, partitions.
๐ป Algorithms
Complexity of sorting, permutations.
โ ๏ธ Common Mistakes to Avoid
- Negative factorial: n! is undefined for n < 0. Use gamma function for non-integers.
- 0! = 0: Wrong. 0! = 1 by convention (empty product, recursive definition).
- Confusing n! and n!!: n!! is double factorial โ multiplies every 2nd number.
- Overflow: 171! exceeds JavaScript number precision. Use Stirling for large n.
- Trailing zeros: Count = floor(n/5) + floor(n/25) + floor(n/125) + ...
๐ฏ Expert Tips
๐ก Stirling for Large n
For n > 100, exact factorial exceeds precision. Use Stirling's approximation.
๐ก Double Factorial
8!! = 8ร6ร4ร2 = 384. For odd n: 7!! = 7ร5ร3ร1 = 105.
๐ก Trailing Zeros
Number of trailing zeros in n! = floor(n/5) + floor(n/25) + ...
๐ก Binomial Link
C(n,k) = n!/(k!(n-k)!). Factorials are essential for combinatorics.
๐ Reference Table
| n | n! |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
| 5 | 120 |
| 6 | 720 |
| 7 | 5040 |
| 8 | 40320 |
| 9 | 362880 |
| 10 | 3628800 |
๐ Quick Reference
๐ Practice Problems
โ FAQ
Why is 0! = 1?
By convention, to make formulas like C(n,0)=1 and the empty product consistent. It also fits n! = n ร (n-1)! when n=1.
What is the largest factorial I can compute exactly?
170! is the largest that fits in a 64-bit double. This calculator uses BigInt for exact values up to 170!.
When to use Stirling's approximation?
For n > 100 when you need an estimate. Error drops below 1% for n โฅ 10 and below 0.1% for n โฅ 50.
What is a derangement?
A permutation where no element stays in its original position. !n counts derangements of n objects.
How many trailing zeros does 100! have?
floor(100/5) + floor(100/25) = 20 + 4 = 24 trailing zeros.
What is double factorial?
n!! = n ร (n-2) ร ... ร 1 (odd n) or ร 2 (even n). 8!! = 8ร6ร4ร2 = 384.
Can I compute factorial of a decimal?
Not directly. Use the gamma function: ฮ(n+1) = n! for real n.
๐ Summary
n! = n ร (n-1) ร ... ร 1 with 0! = 1. Factorials count permutations and appear in combinations, probability, and series. Use Stirling for large n. Double and subfactorial extend the concept.
โ Verification Tip
Check n! = n ร (n-1)!. For small n, multiply manually. Compare Stirling with exact for n โค 170.
๐ Next Steps
Explore the Permutation Calculator, Combination Calculator, or Multifactorial Calculator for n!!, n!!!, n!!!!.
โ ๏ธ Disclaimer: For educational use. Exact factorials use BigInt; Stirling for large n. Not for cryptographic applications.
Related Calculators
Permutation Calculator
Calculate P(n,r) = n!/(n-r)! โ the number of ways to select and arrange r items from n distinct items where order matters. Includes permutations with...
MathematicsMultifactorial Calculator
Free multifactorial calculator for n!, n!!, n!!!, n!!!!. Step-by-step multiplication chains. Compare single, double, triple, and quadruple factorials....
MathematicsBinomial Coefficient Calculator
Calculate binomial coefficients C(n,k) = n!/(k!(n-k)!) and binomial expansions. View Pascal's triangle rows, apply symmetry and Pascal's identity, and get step-by-step solutions for combinatorics and algebra.
MathematicsCombinations & Permutations with Replacement Calculator
Calculate combinations and permutations with replacement. Compare CR(n,r), PR(n,r), C(n,r), and P(n,r) side by side with step-by-step solutions and...
MathematicsCombination Calculator
Calculate C(n,r) and CR(n,r) combinations. Choose r from n items with or without replacement. Real-world probability for poker hands, lottery, ice cream...
MathematicsAbsolute Change Calculator
Calculate absolute and relative change between two values. Get direction (increase/decrease), percentage impact, and step-by-step solutions. Simple mode for...
Mathematics