Work out permutation with repetition instantly with clear inputs, formula shown and shareable results.
When repetition is allowed each of the r positions can independently take any of the n values, giving nʳ arrangements. Forbidding repeats reduces the choices at each step, giving n(n−1)…(n−r+1).
With repetition
nʳ
Without repetition
P(n, r) = n!/(n − r)!
10⁴ = 10000 with repeats allowed, but only 5040 if every digit must differ.
log₂ of the count is the entropy in bits, which is the standard way to quantify password or key strength.