ALGEBRAArithmeticMathematics Calculator
!

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.

Concept Fundamentals
n! = nร—(nโˆ’1)ร—...ร—1
Definition
1 (convention)
0!
n! arrangements
Permutations
n! โ‰ˆ โˆš(2ฯ€n)(n/e)โฟ
Stirling

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โ†’โˆž.

Key quantities
n! = nร—(nโˆ’1)ร—...ร—1
Definition
Key relation
1 (convention)
0!
Key relation
n! arrangements
Permutations
Key relation
n! โ‰ˆ โˆš(2ฯ€n)(n/e)โฟ
Stirling
Key relation

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.

n! grows very fast: 10! = 3,628,800.Permutations of n objects = n!.

Run the calculator when you are ready.

Calculate FactorialEnter n for n!
factorial.sh
CALCULATED
$ factorial --n=5 --mode=standard
n!
120
n!!
15
!n
44
Factorial Calculator
5! = 120
5!! = 15
numbervibe.com
Share:

Factorial Growth

Result Magnitude

๐Ÿ“ Step-by-Step Breakdown

SETUP
Identify n
n = 5
METHOD
Expand
5! = 5 ร— 4 ร— 3 ร— ... ร— 2 ร— 1
RESULT
Result
5! = 120
Double factorial
5!! = 15
n imes (n-2) imes ... imes 1 ext{or} 2
Subfactorial
!5 = 44
ext{Derangements} ( ext{no} ext{fixed} ext{points})

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?

๐Ÿ“5! = 120 equals the number of ways to arrange 5 distinct objects in a row.Source: Combinatorics
โฑ๏ธ10! = 3,628,800 seconds is exactly 6 weeks.Source: Time Conversion
๐ŸŽฒFactorials appear in permutations, combinations, and probability.Source: Probability
๐Ÿ“ˆFactorial growth is faster than exponential โ€” 20! has 19 digits.Source: Growth Rates
๐Ÿ”ฌStirling's formula gives <1% error for n โ‰ฅ 10.Source: Approximation
๐Ÿ“šThe gamma function ฮ“(n+1) = n! extends factorials to real numbers.Source: Analysis

๐Ÿ“– 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

nn!
01
11
22
36
424
5120
6720
75040
840320
9362880
103628800

๐Ÿ“ Quick Reference

0!
= 1
5!
= 120
10!
= 3,628,800
170!
Max exact

๐ŸŽ“ Practice Problems

6! = ? Answer: 720
Trailing zeros in 25!? Answer: 6
C(5,2) = 5!/(2!3!) = ? Answer: 10
!4 (derangements) = ? Answer: 9

โ“ 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.

๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI

Related Calculators