4-digit PIN
- Input
- PR(10, 4)
- Expected output
- 10000
All 10,000 combinations are valid even when repeating a digit, like 0000 or 1111; the no-repetition version would require 4 distinct digits and have only 5,040.
permutations in passwords and security
PR(n,r) = nʳ counts passwords where order matters and any character can repeat, so 'ab' and 'ba' count as two different passwords even though they use the same two characters. For 8 characters drawn from a 62-symbol alphabet (a-z, A-Z, 0-9), the search space is 62⁸ = 218,340,105,584,896 combinations.
All 10,000 combinations are valid even when repeating a digit, like 0000 or 1111; the no-repetition version would require 4 distinct digits and have only 5,040.
The 62 comes from 26 lowercase plus 26 uppercase plus 10 digits; no thousands formatting appears because the result comes straight from the BigInt.
95 is the total count of printable ASCII characters, from space (32) to tilde (126); the extra space over the alphanumeric set multiplies the result by roughly 30.
A permutation is an ordered arrangement of r elements chosen from a set of n; order matters, so AB and BA count as different permutations. Without repetition the number of arrangements is P(n, r) = n! / (n − r)!. For example, arranging 3 of the letters A, B, C, D gives P(4, 3) = 4 · 3 · 2 = 24 ordered sequences.
Length, because it acts as the exponent: going from 8 to 9 characters with 62 symbols multiplies the space by 62, while switching the whole alphabet from 62 to 95 symbols at the same 8-character length only multiplies it by roughly 30. One extra character outweighs doubling the alphabet size.
Because PR(n,r) is a permutation, not a combination: character order matters. A 2-character password from the alphabet {a,b} has PR(2,2) = 4 possibilities (aa, ab, ba, bb), against only 3 if order did not matter.
Yes, this calculator's toggle switches between PR(n,r) = nʳ with repetition and P(n,r) = n!/(n-r)! without repetition; the no-repetition mode is the same one used on the total permutation page when r = n, but here r can be smaller than n.
P(n, r) = n! / (n−r)!
All calculations stay in your browser. No data is sent to any server.