What This Calculator Does
The Permutations with Replacement Calculator counts how many ordered arrangements you can make when repetition is allowed. You choose from n types of items and fill r positions, and because each item type can be reused, every position has the same number of choices. The result is simply n raised to the power of r. This is the classic counting rule for situations like PIN codes, passwords, dice rolls, and license plates where the same value can appear more than once.
The Inputs You Provide
- Number of types of items (n): how many distinct options are available for each position — for example, 10 digits (0–9) or 26 letters.
- Number of positions to fill (r): how many slots you need to fill, such as 4 digits in a PIN.
Both inputs are read as whole numbers. The tool then returns the total count of possible ordered sequences.
The Formula
The calculation uses the permutations-with-replacement rule:
$$P(n, r) = n^{r}$$
The logic is straightforward: the first position can be any of n items, the second can also be any of n items (repetition is allowed), and so on for all r positions. Multiplying n by itself r times gives \(n^{r}\). Order matters here, so "AB" and "BA" count as different arrangements.
Worked Example
Suppose you want to count every possible 4-digit PIN. There are 10 digit types (0 through 9), so n = 10, and you fill 4 positions, so r = 4.
- \(P(10, 4) = 10^{4}\)
- \(= 10 \times 10 \times 10 \times 10\)
- = 10,000 possible PINs (from 0000 to 9999).
Enter n = 10 and r = 4, and the calculator returns 10,000.
Frequently Asked Questions
How is this different from regular permutations? Standard permutations without replacement use \(n!/(n-r)!\) because items can't repeat. With replacement, every position still has n choices, giving \(n^{r}\), which produces a larger count.
Does order matter in this calculation? Yes. Each arrangement is treated as an ordered sequence, so different orderings of the same items are counted separately. If order did not matter, you would use a combinations-with-replacement formula instead.
Can r be larger than n? Absolutely. Because items are reused, r can exceed n with no problem — for example, a 6-character code from 4 symbols gives \(4^{6} = 4{,}096\) results.
Related calculators
- Combinations Calculator — n choose r (nCr).
- Permutations Calculator — nPr from n and r.
- Combinations with Replacement — combinations with repetition.
- Permutations & Combinations — both nPr and nCr.
- Factorial Calculator — compute n!.