DOC

How calculators work

Factorial Counts Orders, Not Just Big Multiplications

Factorial is useful when distinct objects fill distinct positions. Learn what n! counts, when it is the wrong tool, why 0! equals 1, and why displays overflow so quickly.

Five books are sitting in a stack. You clear one shelf and decide to display all five. The first slot can take any book. After that choice, four remain for the second slot, then three, two, and one. Nothing about the shelf looks enormous, yet it permits 120 different orders.

That is the story hidden inside 5!. The factorial key is not mainly a shortcut for a descending multiplication. It is a counting tool for situations where every object is distinct, every position is filled, and changing the order creates a different outcome.

Use n! whenall n objects are usedobjects are distinctorder matters

The product follows the shrinking choice set

For the shelf, the count is:

5 choicesx4 choicesx3 choicesx2 choicesx1 choice= 120 orders

The multiplication principle is doing the real work. Each first choice can be followed by four second choices. Each of those can be followed by three third choices, and so on. Factorial packages that repeated branching into one symbol:

n! = n x (n - 1) x (n - 2) x ... x 1

Five distinct books branching through five, four, three, two, and one remaining shelf choices
Each placement reduces the remaining choices by one, so the total multiplies instead of merely adding.

Three questions decide whether factorial fits

Factorial is often overused because the notation is memorable. Before pressing !, test the problem:

1Are all objects used?If only r of n objects are selected, the answer is usually not n!.
2Are the objects distinct?If some are identical, n! counts duplicate arrangements.
3Does order matter?If ABC and CBA are the same outcome, factorial alone is too large.

Here are three nearby problems that need different tools:

ProblemCorrect structureWhy
Arrange five different books5! = 120All five are used and every order is different
Choose three of five books for a bag5C3 = 10The selected group matters, not its listing order
Arrange the letters in LEVEL5! / (2! x 2!) = 30The two Ls and two Es create duplicate orders

The repeated-letter example shows why “number of objects” is not enough. Factorial assumes labels that distinguish every object. When objects repeat, divide out the internal swaps that do not create a new visible arrangement.

Descending number tiles multiplying into one rapidly growing factorial value
The algorithm can be a short loop even when the count represents millions of arrangements.

Why zero factorial equals one

0! = 1 sounds like a special favor granted to formulas. It is better understood as a boundary count.

There is one way to arrange zero objects: leave the arrangement empty. The same value also preserves the recurrence

n! = n x (n - 1)!

because 1! = 1 x 0! requires 0! = 1. That single boundary value keeps permutation and combination formulas working when nothing is selected or everything is selected.

objects available: 0positions to fill: 0valid empty arrangement: 1

A small input can exceed the display

Factorial grows much faster than an exponential with a fixed base over the ranges people first encounter:

5!120
10!3,628,800
20!2,432,902,008,176,640,000

A calculator may switch to scientific notation, lose exact integer display, or report a range error. That is an implementation boundary, not evidence that factorial stopped being defined. Casio’s current manual describes its factorial command for zero or positive integer inputs; exact ranges and error behavior remain model-specific.

Factorial values expanding beyond a finite numerical display boundary
The mathematical count keeps growing after the device runs out of room to show it exactly.
Do not ask only “can I press n!?” Ask whether the problem really contains n distinct objects filling n ordered positions.

Sources and further reading