10,000
10,000
4
0.0001
10,000
10,000
4
0.0001
Permutations with replacement count the number of ordered sequences where items can be reused. This is the simplest and most common counting model: for each of r positions, you independently choose from n options, and the same option can appear multiple times. The total count is n raised to the power r (n^r).
This model appears everywhere in daily life. A 4-digit PIN using digits 0-9 has 10^4 = 10,000 possibilities. A password of 8 characters from a 62-character alphabet (a-z, A-Z, 0-9) has 62^8 ≈ 218 trillion possibilities. The number of possible DNA sequences of length k is 4^k (four nucleotide bases). Every multiple-choice exam where each question has n options independently has n^(number of questions) possible answer sheets.
The exponential growth of n^r is what makes longer passwords dramatically more secure. Going from 8 to 12 characters with a 62-character alphabet increases possibilities by a factor of 62^4 ≈ 14.8 million. This is the fundamental principle behind brute-force resistance in cryptography and the reason security experts recommend longer passwords over more complex but shorter ones.
Our calculator computes n^r using logarithms to handle extremely large results, and also provides the log base 10 (useful when the answer has many digits) and the probability of one specific sequence (1/n^r). Enter the number of available options and the number of positions to fill to see the total count.
The formula for permutations with replacement is simply:
$$\text{Total} = n^r$$
This follows from the multiplication principle: if there are n choices for the first position, n for the second, and so on for r positions, the total is n × n × ... × n (r times) = n^r.
To avoid overflow for large values, we compute in log-space:
$$\ln(n^r) = r \cdot \ln(n)$$
$$\log_{10}(n^r) = r \cdot \log_{10}(n)$$
The probability of any one specific sequence is:
$$P = \frac{1}{n^r} = n^{-r}$$
The result represents the total number of distinct ordered sequences of length r where each element is chosen from n options with replacement. A log₁₀ value of 6 means approximately 1 million sequences. For security applications, each additional character multiplies the total by n, so adding one digit to a numeric PIN multiplies possibilities by 10. Generally, log₁₀ > 12 is considered computationally difficult to brute-force.
Inputs
Results
10,000 possible PINs. A random guess has a 0.01% success probability.
Inputs
Results
Over 218 trillion possibilities. At 1 billion guesses/sec, brute force takes ~2.5 days.
With replacement, each item can be used multiple times (like digits in a PIN — you can use 1-1-1-1). Without replacement, each item can only be used once (like assigning unique medals). With replacement gives n^r; without gives n!/(n-r)!.
Because each additional character multiplies the total by n. Going from 8 to 12 characters with 62 options multiplies the search space by 62^4 ≈ 14.8 million. This exponential growth is why length is the most effective way to increase password strength.
A binary string of k bits has 2^k possible values, which is a permutation with replacement where n=2 and r=k. An 8-bit byte has 2^8 = 256 values, a 32-bit integer has 2^32 ≈ 4.3 billion, and a 256-bit key has 2^256 ≈ 1.16 × 10^77 possibilities.
Yes, unlike permutations without replacement, r can exceed n because items are reused. A 20-character password from 26 letters is perfectly valid: 26^20 ≈ 1.95 × 10^28 possibilities.
The sample space of r independent experiments with n outcomes each has n^r elements. For example, flipping a coin 10 times has 2^10 = 1,024 possible sequences. Calculating the probability of specific patterns (like exactly 5 heads) requires dividing by this total.
The information content (entropy) of a random sequence of r choices from n options is r × log₂(n) bits. A 10-character alphanumeric password carries approximately 10 × log₂(62) ≈ 59.5 bits of entropy.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!