Permutations of k from n:
P(n, k) = n! / (n - k)!
There are n choices for the first position, n - 1 for the second, and so on for k positions. The factorial ratio is just that product written compactly.
Combinations of k from n:
C(n, k) = n! / ( k! (n - k)! )
Count the ordered arrangements, then divide by k! because each unordered selection was counted once for every order its members could have appeared in.
The readout makes the relationship concrete: at n = 12, k = 5 the ordered count is 95,040 and the unordered is 792, and 95,040 / 792 is exactly 120 = 5!.
Reading the shape
The bars are C(n, k) for every k from 0 to n.
Symmetric. C(n, k) = C(n, n-k), because choosing which k to keep is the same act as choosing which n - k to leave.
Largest in the middle. There are far more ways to pick half of something than to pick almost none or almost all.
Enormous quickly. Drag n to 24 and the middle bar passes two and a half million. This growth is why brute force over subsets is hopeless past small n, and why the readout switches to scientific notation.
That row of numbers is a row of Pascal's triangle, and the recurrence C(n,k) = C(n-1,k-1) + C(n-1,k) — either the last item is in your selection or it is not — is the standard dynamic-programming way to compute them without factorials.
With repetition
A third case, easy to miss. If the same item can be chosen more than once and order matters — a 4-digit PIN, where digits may repeat — the count is simply n^k. The readout gives this alongside.
At n = 10, k = 4 that is 10,000 PINs, against P(10, 4) = 5,040 if no digit could repeat.
Why it matters here
Binomial probabilities. The C(n, k) in [the binomial](bernoulli_binomial_poisson.html) is exactly this count — the number of orders in which k successes could have arrived.
Hypothesis testing. Permutation tests build a null distribution by enumerating or sampling rearrangements of the labels, and the count above says whether enumeration is feasible.
Cross-validation. The number of ways to split data into folds.
Feature selection. Choosing k features from n is C(n, k), which is why exhaustive search is abandoned almost immediately and greedy or regularised methods are used instead.
Complexity arguments. A great deal of "this is exponential" is this table growing.
Where it goes wrong
Not asking whether order matters. The commonest error, and it is a factor of k!.
Computing factorials directly. 21! overflows a 64-bit integer, and C(n, k) is usually far smaller than the factorials used to define it. Work in logarithms, or use the multiplicative recurrence, which is what this page does.
Forgetting repetition is allowed. Passwords, dice and sampling with replacement all permit it.
Double counting. When the objects are not all distinguishable the plain formulas over-count, and the multiset versions are needed instead.