Factorial Calculator

Factorial of any non-negative integer.

Overview

Calculates the factorial (n!) of positive integers and evaluates combinations, permutations, and Stirling's asymptotic approximations for large numbers.

Formula & Calculation Method

n! = n × (n - 1) × (n - 2) × ... × 3 × 2 × 1 | 0! = 1 by definition

Computes the total number of unique ways to arrange n distinct objects in a sequence.

Worked Example: Calculating 6 Factorial (6!)

Inputs: Integer n = 6

  • Multiply descending sequence: 6 × 5 × 4 × 3 × 2 × 1
  • Step 1: 6 × 5 = 30
  • Step 2: 30 × 4 = 120
  • Step 3: 120 × 3 = 360
  • Step 4: 360 × 2 = 720

Summary: 6! = 720 | Permutations = 720 Arrangements

Common Use Cases

  • Combinatorics & Probability: Calculate probability distributions, poker hand odds, and lotto combinations.
  • Algorithm Analysis: Benchmark the time complexity of brute-force Travelling Salesperson problems (O(n!)).
  • Taylor Series Expansions: Evaluate polynomial series denominators for e^x, sin(x), and cos(x).

Frequently Asked Questions

Why does 0 factorial equal 1 (0! = 1)?

There is exactly 1 way to arrange zero objects (the empty set); algebraically, n! = (n+1)! / (n+1), so 0! = 1! / 1 = 1.

Can you calculate factorials for non-integers?

Yes, the Gamma function Γ(n) generalizes factorials to real and complex numbers, where Γ(n+1) = n!.

How large is 100!?

100! is approximately 9.33 × 10^157, a 158-digit number that far exceeds the total estimated atoms in the observable universe.

Related Calculators & Tools