Skip to main content

🔢 Factorial Calculator

Calculate n! for 0 ≤ n ≤ 170

10!
3,628,800
10! = 10×9×8×7×6×5×4×3×...
Common Factorial Values
nn!
0!1
1!1
2!2
3!6
4!24
5!120
6!720
7!5,040
8!40,320
9!362,880
10!3,628,800
12!479,001,600
15!1,307,674,368,000
20!2,432,902,008,176,640,000

Factorial Calculator Guide

The Factorial Calculator quickly computes the factorial of a positive integer n, denoted n!. A factorial is the product of all positive integers less than or equal to n. This tool supports the range 0 to 170 (limited by JavaScript floating-point precision) and automatically displays large results in scientific notation.

Factorial is a fundamental concept in combinatorics, with important applications in permutations and combinations, probability and statistics, Taylor series expansion, and more. Understanding factorial concepts and properties is a necessary foundation for studying advanced mathematics. This tool also provides a quick reference table of common factorial values.

Definition and Properties of Factorial

【Definition】n! = n × (n-1) × (n-2) × ... × 2 × 1
【Special Values】0! = 1 (by convention), 1! = 1
【Recurrence】n! = n × (n-1)!
【Growth Rate】Factorial grows faster than exponential functions (Stirling's approximation)
【Stirling's Formula】n! ≈ √(2πn) × (n/e)^n
【Range Limit】JavaScript double precision can accurately represent up to 170!

Practical Examples

📋
【Example 1】Calculate 5! 5! = 5 × 4 × 3 × 2 × 1 = 120 Application: Number of ways to arrange 5 distinct elements 【Example 2】Calculate 10! 10! = 3,628,800 Application: Number of ways to line up 10 people 【Example 3】Calculate 20! 20! = 2,432,902,008,176,640,000 Application: Part of the total possible shuffles of a deck of 52 cards 【Example 4】Calculate 100! 100! ≈ 9.33 × 10^157 This is a 158-digit enormous number!

Important Notes

💡
- Factorial is only defined for non-negative integers; decimals and negative numbers are not supported (the Gamma function extends to real numbers) - 170!≈7.26×10^306 is the largest factorial JavaScript can precisely represent - 0! = 1 is a mathematical convention (empty product), not a calculation error - n! grows extremely fast: 70! already exceeds 10^100 (a googol) - Large factorials have important applications in cryptography (e.g., RSA algorithm security is based on the difficulty of large number factorization)

Application Scenarios

  • - Permutations and combinations: P(n,r)=n!/(n-r)! for permutation count
  • - Probability theory: Core component of binomial distribution, Poisson distribution formulas
  • - Taylor series: Power series expansions of e^x, sin(x), cos(x) include factorial terms
  • - Statistics: Multinomial coefficients, hypergeometric distribution calculations
  • - Cryptography: Large number operations in RSA encryption key generation

Factorial and the Gamma Function

Factorial can be extended to non-integer values through the Gamma function Γ(n). For positive integers n, the relationship is: Γ(n) = (n-1)!. The Gamma function is also defined on the complex plane and is an important special function in mathematical analysis.

Some useful fractional factorial values (via the Gamma function): (1/2)! = Γ(3/2) = √π/2 ≈ 0.886 This result appears in the probability density function of the normal distribution, reflecting the connection between factorial concepts and continuous mathematics.

Ad Slot