Count all possible arrangements when repetition is allowed. Enter the number of elements and positions - get variations with repetition, permutations without, and a brute-force time estimate.
Variations with Repetition Calculator - PIN Codes, Passwords
Count all possible arrangements when repetition is allowed. Enter the number of elements and positions - get variations with repetition, permutations without, and a brute-force time estimate.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
How many four-digit PINs exist?
A standard bank PIN uses digits 0 through 9, giving 10 possible digits per position. With 4 positions and repetition allowed (the same digit can appear more than once), the total number of PINs is 10 x 10 x 10 x 10 = 10,000. That single multiplication captures the essence of variations with repetition. This calculator generalises that idea to any number of elements and any number of positions, and adds a comparison with the case where repetition is not allowed.
The two formulas explained
Combinatorics draws a sharp line between two scenarios: whether you are allowed to reuse an element or not.
| Type | Formula | Repetition allowed? | Typical use |
|---|---|---|---|
| Variations with repetition | V'(n,k) = n^k | Yes | PIN codes, passwords, dice rolls |
| Permutations without repetition | V(n,k) = n! / (n-k)! | No | Race finishing orders, safe combinations, unique codes |
The key insight: when repetition is allowed, every position is independent and always has n choices. When repetition is forbidden, each successive position has one fewer choice because the previously chosen element is removed.
Common examples reference table
| Scenario | n | k | V'(n,k) = n^k | V(n,k) no repeat |
|---|---|---|---|---|
| 4-digit PIN (digits 0-9) | 10 | 4 | 10,000 | 5,040 |
| 8-char password (a-z only) | 26 | 8 | 208,827,064,576 | 62,990,928,000 |
| 6-char password (a-z + 0-9) | 36 | 6 | 2,176,782,336 | 1,402,410,240 |
| 7-digit phone number (0-9) | 10 | 7 | 10,000,000 | 604,800 |
| 3-digit combination lock (0-9) | 10 | 3 | 1,000 | 720 |
| 6-char plate (A-Z + 0-9) | 36 | 6 | 2,176,782,336 | 1,402,410,240 |
Practical examples
A 4-digit PIN uses digits 0-9 (n = 10) and allows the same digit to appear more than once (e.g. 1111 is valid). This is variations with repetition: V'(10, 4) = 10^4 = 10,000. If you were forced to use four different digits, you would have V(10, 4) = 10 x 9 x 8 x 7 = 5,040 options - almost half as many.
An 8-character password using only lowercase English letters (n = 26): V'(26, 8) = 26^8 = 208,827,064,576 - over 208 billion combinations. At 1 billion guesses per second a computer would need about 3.5 minutes on average to crack it. Mixing in uppercase letters and digits raises n to 62 and the count to 26^8 is dwarfed by 62^8 = 218,340,105,584,896, which takes years.
Rolling a standard six-sided die 3 times gives n = 6, k = 3: V'(6, 3) = 6^3 = 216 possible sequences. Each outcome (e.g. 3-1-6) is distinct from (6-1-3) because order matters. If you wanted three rolls all showing different faces, that would be V(6, 3) = 6 x 5 x 4 = 120 sequences.
An RGB colour is three independent bytes, each with values 0-255 (n = 256). The total number of possible colours is V'(256, 3) = 256^3 = 16,777,216 - exactly the 16.7 million colours of 24-bit colour space. Since each byte is independent and repeats are allowed, this is a textbook variations-with-repetition problem.
Eight runners compete. How many different top-3 finishing orders are there? Each position must be a different runner, so no repetition: V(8, 3) = 8 x 7 x 6 = 336. The calculator shows this as the "permutations without repetition" result when you enter n = 8, k = 3.
For n = 10, k = 4 the ratio V'(n,k) / V(n,k) = 10,000 / 5,040 = 1.98x. For n = 26, k = 8 the ratio is 208,827,064,576 / 62,990,928,000 = 3.32x. The more positions and the smaller the alphabet, the bigger the gap between the two formulas. The calculator always displays this ratio so you can immediately see how much repetition adds.
Security classification explained
| Space size (V') | Classification | Practical meaning |
|---|---|---|
| Up to 100 | Very small space - can be checked manually | A human can try every option by hand in minutes |
| 101 - 1,000 | Small space - easy to guess | A script cracks it in milliseconds |
| 1,001 - 100,000 | Medium space - a computer cracks it in seconds | Acceptable only with strict rate limiting |
| 100,001 - 1 billion | Large space - requires time or a clever method | Seconds to minutes without rate limiting |
| 1B - 1 trillion | Huge space - brute force takes minutes to hours | Reasonable for low-value secrets with no lockout |
| Over 1 trillion | Enormous space - practically immune to brute force | Years to centuries even with dedicated hardware |
Note: the brute-force estimate assumes 1 billion attempts per second on a single machine with no rate limiting or lockout. Real-world login systems enforce lockouts after a few failed attempts, which makes even small spaces effectively uncrackable through a live interface. The estimate is most relevant for offline attacks against stolen password hashes.
When to use which formula
The choice between the two formulas comes down to one question: can the same element appear more than once?
- Use variations with repetition (n^k) when an element can be reused: PIN codes, passwords, dice sequences, binary strings, colour channels, lottery ticket numbers where you pick the same number twice.
- Use permutations without repetition (n!/(n-k)!) when each element can appear at most once: finishing orders in a race, arranging books on a shelf, selecting officers from a club, dealing unique playing cards.
- If k = n and repetition is forbidden, the formula simplifies to n! (a full permutation): the number of ways to arrange all n elements in a row.
- If order does not matter (only which elements are chosen, not in what sequence), you need combinations C(n, k) = n! / (k! x (n-k)!) instead of variations.
How the brute-force time is calculated
The calculator divides the total number of arrangements (n^k) by an assumed attack rate of 1,000,000,000 guesses per second (1 billion per second). This represents a typical speed for a modern CPU cracking a fast hash like MD5 or for trying PINs over a local interface without a lockout.
GPU clusters can reach 10 to 100 billion guesses per second for fast hashes, which would reduce the time estimates by a factor of 10 to 100. Slow hashes like bcrypt or Argon2 can be limited to fewer than 1,000 guesses per second per GPU, increasing the effective time by a factor of one million or more. Use the brute-force estimate as a rough benchmark, not a guarantee.
FAQ
Related tools
Combinatorics Calculator
Calculate factorials n! - the building block behind permutations and combinations - Open calculator
Probability Calculator
Calculate the probability of events as fraction, decimal, percentage and odds - Open calculator
Percentage Calculator
Calculate X% of a number, find what percent X is of Y, or compute percentage change - Open calculator
Factorial Calculator
Compute n! for any non-negative integer, used in permutation and combination formulas - Open calculator
Power Calculator
Compute any base raised to any exponent and extract roots - the core operation behind n^k - Open calculator