What Is Permutation With Repetition?
Permutation with repetition counts the number of ways to fill r positions from n types of items, where each type can be used unlimited times. This is the simplest counting formula in combinatorics and applies to scenarios like PIN codes, license plates, and binary strings.
For example, a 4-digit PIN code uses 10 digits (0-9) with repetition allowed, giving 10^4 = 10,000 possible codes. The digit 1 can appear in all four positions (1111 is valid), unlike permutations without repetition.
Formula
This is simply n multiplied by itself r times. For each of the r positions, there are n independent choices, giving n × n × ... × n = n^r total arrangements.
Examples
| Scenario | n | r | n^r |
|---|---|---|---|
| 4-digit PIN | 10 | 4 | 10,000 |
| Binary string (8 bits) | 2 | 8 | 256 |
| DNA sequence (4 bases, 10 long) | 4 | 10 | 1,048,576 |
| Hex color codes | 16 | 6 | 16,777,216 |
With vs Without Repetition
- With repetition (n^r): Always more arrangements because items can be reused.
- Without repetition (n!/(n-r)!): Fewer arrangements since each item is used once.
- When n is much larger than r, the difference becomes smaller.
- With repetition allows r > n (unlike without repetition).
Frequently Asked Questions
Can r be larger than n?
Yes! With repetition, r can be any positive integer regardless of n. A 20-character password from 26 letters (26^20) is perfectly valid even though 20 > 26 is false here, and sequences longer than n are allowed.
How is this different from combinations with repetition?
Permutations with repetition care about order (AB differs from BA), while combinations with repetition do not (AB = BA). The formula for combinations with repetition is C(n+r-1, r), which is much smaller than n^r.
Why do passwords use this formula?
Passwords allow any character in any position, and characters can repeat. A password of length r from an alphabet of n characters has exactly n^r possibilities, which is why longer passwords and larger character sets dramatically increase security.