Ekuation

operation

Factorial Calculator -- n!

Compute n! exactly for any n up to 10,000 using BigInt, with digit count and Stirling approximation.

Back to Combinatorics Calculator

Die Gesamtzahl der verschiedenen Elemente in der Menge

Formel
n!n!

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⁶⁷

Dokumentation

What Is a Factorial?

The factorial of a non-negative integer nn, written n!n!, is the product of all positive integers up to nn:

n!=n×(n1)×(n2)××2×1n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1

By convention, 0!=10! = 1. This isn't arbitrary — it ensures that (n0)=1\binom{n}{0} = 1 and that the recurrence n!=n×(n1)!n! = n \times (n-1)! holds for n=1n = 1.


Factorial Values

nn!Digits
011
51203
103,628,8007
151,307,674,368,00013
202,432,902,008,176,640,00019
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 nn, computing n!n! exactly is impractical. Stirling's formula gives an excellent approximation:

n!2πn(ne)nn! \approx \sqrt{2\pi n} \left(\frac{n}{e}\right)^n

The relative error shrinks as nn grows — it's already within 1% at n=10n = 10 and within 0.1% at n=50n = 50.


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):

Γ(n)=(n1)!for positive integers\Gamma(n) = (n-1)! \quad \text{for positive integers}
Γ(z)=0tz1etdt\Gamma(z) = \int_0^{\infty} t^{z-1} e^{-t} \, dt

This gives meaningful values like (12)!=π2\left(\frac{1}{2}\right)! = \frac{\sqrt{\pi}}{2}, which appears in statistics (the normal distribution) and physics.


Frequently Asked Questions

What is a factorial?

The factorial of a non-negative integer nn, written n!n!, is the product of all positive integers from 1 to nn. For example, 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120. By convention, 0!=10! = 1.

Why does 0! equal 1?

0!=10! = 1 is defined by convention to make mathematical formulas consistent. It ensures that the binomial coefficient C(n,0)=1C(n, 0) = 1 (there is exactly one way to choose nothing) and that the recurrence n!=n×(n1)!n! = n \times (n-1)! holds when n=1n = 1.

How fast does the factorial function grow?

Factorials grow faster than exponential functions. 10!=3,628,80010! = 3{,}628{,}800 (7 digits), 20!20! has 19 digits, and 52!52! (ways to shuffle a deck of cards) has 68 digits. By comparison, 2202^{20} is only about 1 million.

What is Stirling's approximation?

Stirling's approximation estimates large factorials: n!2πn×(n/e)nn! \approx \sqrt{2\pi n} \times (n/e)^n. The relative error is under 1% for n10n \geq 10 and under 0.1% for n50n \geq 50. 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: Γ(n)=(n1)!\Gamma(n) = (n-1)! for positive integers, extended to all real numbers except non-positive integers via an integral. For example, (1/2)!=π20.886(1/2)! = \frac{\sqrt{\pi}}{2} \approx 0.886, which appears in the normal distribution formula.

Related operation Variants

Explore more operation options

More Math Calculators

Explore the category

Rechnersuche

Rechner suchen und finden