Permutations with Replacement Calculator (n^r)
Calculate PR(n,r) = n^r, the number of ordered arrangements of r positions where each pick can repeat — PIN codes, passwords, license plates — with steps shown.
How to use this calculator
Enter n (how many symbols are available at each position) and r (how many positions you are filling). The calculator returns PR(n, r) = n^r — the number of ordered arrangements where repetition is allowed — along with the position-by-position reasoning.
Repetition is allowed — the key difference from nPr
Ordinary permutations remove each chosen item from the pool, so nothing repeats. Permutations with replacement drop that rule: every position is filled independently from the full set of n symbols, so the same symbol can appear more than once. That's exactly how a PIN code works — the digit 7 can appear in position 1 and position 3 of the same code.
Each of the r positions has n independent choices, so the counts multiply: n × n × n × … (r times).
Worked example — a 3-digit PIN from 5 symbols
Position 1 has 5 possible digits, position 2 has the same 5 (a digit can repeat), and position 3 has the same 5 again — nothing is removed after a digit is used. Multiplying the three independent choices together gives 125 possible codes.
The four ways to sample r items from n
Whether repetition and order matter both change the counting formula. There are exactly four combinations:
| Order matters | Order doesn't matter | |
|---|---|---|
| Without replacement | Permutation: | Combination: |
| With replacement |
This calculator handles the bottom-left cell — order matters and repetition is allowed. It's the only one of the four where r is free to exceed n, since you're never running out of symbols to reuse.
Why r can exceed n here
In ordinary permutations, is required — you cannot arrange more items than exist without reusing one. With replacement, that limit disappears: a 10-character password can still be built from a 5-letter alphabet, since each of the 10 positions independently draws from the same 5 letters. .
Common examples
- 4-digit PIN, digits 0–9: .
- 6-character password, lowercase letters only: .
- License plate, 3 letters then repeats allowed: each letter position is an independent choice from 26.
All three share the same shape: r independent positions, each drawing from the same n-symbol alphabet, giving total arrangements.
Frequently asked questions
- What is 5^3 and why does it count PINs?
- . A 3-digit PIN drawn from 5 possible symbols has 3 positions, and each position independently has 5 choices because digits can repeat, so the total is .
- What does 'with replacement' mean?
- With replacement means a chosen item can be picked again at another position — nothing is removed from the pool after use. A 4-digit PIN allows 7-7-7-7 because each digit is chosen independently from the same full set of 10 digits every time.
- How is this different from a regular permutation (nPr)?
- Ordinary permutations assume every chosen item is removed from the pool, so no value repeats and can never exceed . Permutations with replacement drop that restriction: any symbol can repeat at any position, so the count is simply and can be larger than .
- Why can r be bigger than n here but not in ordinary permutations?
- Because repetition is allowed, you are not running out of distinct items to place — the same n symbols can be reused at every position. A 4-digit PIN (r = 4) drawn from 10 digits (n = 10) is fine, and even a 10-character password (r = 10) from a 5-letter alphabet (n = 5) works: .
- What real-world codes use permutations with replacement?
- PIN codes, passwords built from a fixed character set, license plates, and lock combinations all allow repeated digits or letters, so their total count is , not .
- How many 4-digit PIN codes are possible?
- A standard 4-digit PIN uses digits 0–9 (n = 10) across 4 positions (r = 4), each chosen independently: possible PINs.
- What is n^0?
- Any raised to the power 0 equals 1: there is exactly one way to fill zero positions — the empty arrangement, with nothing chosen.