The factorial of a nonnegative integer n is the product of all positive integers through n. Its notation is n!, with 0! = 1 by definition.
The formula is useful for counting every possible ordering of n distinct objects when all objects must appear exactly once and no ordering restrictions apply. Comparing factorials reveals how dramatically the number of arrangements changes when an additional distinct object is introduced. Four factorial equals 24.
Five factorial equals 120, which is five times larger. Six factorial equals 720, which is six times larger than five factorial. Seven factorial equals 5040, again representing multiplication by the new input rather than a fixed additive increase.
This pattern is important when estimating the size of an ordering problem. A small increase in the number of objects can cause a much larger increase in the number of possible sequences. Factorials therefore help illustrate why exhaustive examination of permutations can become expensive as the number of items grows. At the same time, factorials have clear decision boundaries.
If every item is distinct and the order of all items matters, n! is appropriate. If order does not matter, a combination calculation is usually required.
If only some items are arranged, a partial-permutation formula may be needed. If objects are indistinguishable, n! can count visually identical outcomes more than once.
For example, arranging three letters A, B, and C produces 3! = 6 distinct orders. But arranging A, A, and B produces only three distinct orders: AAB, ABA, and BAA.
Treating the two identical A letters as distinguishable would produce an inflated count. Restrictions create another boundary. If one position must remain fixed, fewer objects are free to move. If some objects must be adjacent or certain sequences are prohibited, unrestricted factorial counts generally include arrangements that should be excluded.
The factorial itself is dimensionless, and its value is exact mathematically. Nevertheless, software precision and supported input size depend on implementation. The available catalog does not verify the engine's numerical limits, input validation, or rounding, so these details must not be inferred from the displayed concept of a factorial calculator.