J-Kit
Português

total permutation and factorial n!

Total Permutation — P(n,n) = n!

P(n,n) = n! counts the ways to order n distinct elements. 10! = 3,628,800. 20! ≈ 2.4 × 10¹⁸.

Factorial applications in ordering

  • Travelling salesman problem: how many routes exist to visit n cities? (n-1)! distinct routes. For 20 cities: 19! ≈ 1.2 × 10¹⁷ routes.
  • Factorial grows faster than any exponential. 100! has 158 digits — far beyond 64-bit floating point (BigInt required).

Examples

52-card deck

Input
P(52, 52) = 52!
Expected output
≈ 8 × 10⁶⁷

Possible deck orders — more than atoms in the observable universe.

5-athlete podium

Input
P(5, 5) = 120
Expected output
120

5! ways to rank 5 athletes.

Full tool FAQ

A permutation is an ordered arrangement of r elements chosen from a set of n. The order of elements matters: AB and BA are different permutations.

Frequently asked questions

Why is 0! = 1?

There is exactly one permutation of zero elements (the empty sequence). Mathematically: n! = n × (n-1)! implies 1! = 1 × 0!, therefore 0! = 1.

Does this page replace official or professional review?

No. It helps explain the scenario and use the tool more safely, but real decisions should consider official sources, full context and qualified guidance when needed.