Permutation With Repetition Calculator - Count n to the r sequences

Permutation with repetition calculator that finds the total number of ordered sequences of length r drawn with replacement from n types, plus the n × n × n chain and chain length.

Updated: June 16, 2026 • Free Tool

Permutation With Repetition Calculator

Number of distinct types available at each draw, for example 10 digits, 26 letters, or 2 binary symbols.

Number of positions in the ordered sequence. Each position is filled independently with replacement.

Results

n to the r (P*(n, r))
0
Total (Exact Read) 0
Chain Length 0
Multiplication Chain 0
Versus P(n, r) Without Repetition 0

What Is Permutation With Repetition Calculator?

A permutation with repetition calculator is a counting tool that finds the number of ordered sequences of length r drawn from n distinct types when each draw is made with replacement. You type the number of types n and the sequence length r, and the tool returns the n to the r total, the multiplication chain n × n × n ... repeated r times, and the chain length. The formula n to the r is the multiplicative form of the classical counting rule, and it is the right tool whenever the same type can appear in more than one position of the sequence.

  • Counting 4-digit PINs: A bank lets a customer pick a 4-digit PIN from 10 digits. Enter n = 10 and r = 4 to read 10 to the 4 = 10,000 possible PINs and the chain 10 × 10 × 10 × 10.
  • Counting short words and codes: Counting 3-letter words from 26 English letters, including nonsense like ZZZ, is 26 to the 3 = 17,576 with chain 26 × 26 × 26.
  • Sizing password and lock combinations: Counting 6-symbol codes from a 36-symbol keyboard is 36 to the 6 with chain 36 × 36 × 36 × 36 × 36 × 36, the sample space for an attempted-guess probability.
  • Counting license plate options: A 7-character license plate that allows repeated letters and digits from 36 symbols produces 36 to the 7 sequences in one read.

When the same type cannot repeat and the items must stay distinct, the Permutation Calculator uses the no-replacement formula n! / (n - r)! and is the right peer for that case.

How Permutation With Repetition Calculator Works

The calculator reads n and r, validates that both are non-negative whole numbers, and then evaluates n to the r with a guarded integer power loop. The multiplication chain is built from r copies of n joined with × markers, so the reader sees exactly which factors were multiplied together.

P*(n, r) = n^r = n × n × n × ... × n (r factors)
  • n (distinct types): Number of distinct types, values, or options available at each draw. The calculator accepts whole numbers from 0 to 99.
  • r (sequence length): Number of positions in the ordered sequence. The calculator accepts whole numbers from 0 to 50. r = 0 returns 1 and r = 1 returns n.
  • n to the r (total count): Product of n with itself r times. The number of ordered r-tuples drawn with replacement from a set of n types.
  • Multiplication chain: The product n × n × n ... written out, with the factor repeated r times so the reader can see how the total is built.

When r grows the total outpaces the screen, so the calculator switches to a digit count and a 16-digit prefix for any result with more than 16 digits and keeps the multiplication chain readable. According to Wolfram MathWorld, the number of length-r sequences drawn with replacement from a set of size n is n to the r, which is the identity this calculator is built around.

Worked example: 4-digit PINs from 10 digits

n = 10, r = 4.

n to the r = 10 to the 4 = 10 × 10 × 10 × 10 = 10,000.

P*(10, 4) = 10,000. Chain length = 4.

There are 10,000 possible 4-digit PINs when every digit can repeat, and the chain 10 × 10 × 10 × 10 shows the four independent draws.

According to Wolfram MathWorld, when repetition is allowed, the number of length-r sequences drawn from a set of n objects is n^r, distinct from the no-repetition count n! / (n - r)!

Readers who want to expand the chain by hand can pipe the base n and the exponent r into the Exponent Calculator to see the same n to the r product with the same chain rendered step by step.

Key Concepts Explained

Four short definitions keep the n to the r formula honest, including the boundary cases that most students trip on first.

With replacement

A draw is with replacement when the type chosen at one position is returned to the pool before the next position is filled, so the same type can appear in more than one position and the count grows by a factor of n at every position.

Ordered sequence

A sequence is ordered when the position of each symbol matters. The sequence ABC is different from BAC and from CBA, so all three count separately toward the n to the r total.

Empty sequence (r = 0)

When r = 0 the sequence is empty, and the count is 1 for any n. This is the empty-product convention and it is what makes n to the 0 equal to 1 for every n greater than 0.

Single-type pool (n = 1)

When n = 1 there is only one type to choose from, so the only sequence of any length r is the same symbol repeated r times.

These definitions matter because the same n and r can produce two different counts depending on whether the draw is with or without replacement. The Permutation Calculator uses the no-replacement count n! / (n - r)!, which is only defined for r <= n; this calculator uses the with-replacement count n to the r. The two formulas agree at r = 0 and at r = 1, and they diverge for every other (n, r) pair where the no-replacement count is defined. When r > n the no-replacement count is undefined, which is one reason the with-replacement formula is the natural fit whenever the same type can sit in more than one position.

The Permutation and Combination Calculator returns both P(n, r) and C(n, r) at once, so it is the right peer when a reader wants to see the ordered count and the unordered count for the same n and r in one place.

How to Use This Calculator

Type n, type r, and read the result panel. The form validates the inputs and the result panel updates as you type, so there is no submit step to remember.

  1. 1 Enter the number of distinct types n: Type the size of the symbol pool in the Distinct Types (n) box. The default 10 covers the most common first-visit case, a 4-digit PIN from 10 digits.
  2. 2 Enter the sequence length r: Type the number of positions in the ordered sequence in the Sequence Length (r) box. The default 4 matches the textbook PIN example.
  3. 3 Read the n to the r total: The first row of the result panel shows P*(n, r) as a comma-separated integer. For the default input the panel reads 10 to the 4 = 10,000.
  4. 4 Read the multiplication chain: The Multiplication Chain row shows the n × n × n × ... product with the factor repeated r times. For n = 10 and r = 4 the chain is 10 × 10 × 10 × 10.
  5. 5 Read the chain length: The Chain Length row shows the number of factors that were multiplied together, which is r. It distinguishes the n to the r result from the no-replacement count.
  6. 6 Fix validation errors before trusting the result: If either input is negative or outside the cap, the panel surfaces an inline error. Adjust the inputs and the result panel updates on the next keystroke.

A user is sizing a 6-character password that mixes 36 digits and letters. They enter n = 36 and r = 6 and read 36 to the 6 = 2,176,782,336 with chain length 6, so they can quote the sample space alongside the attempted-guess probability.

A reader sizing the sample space of a real password or PIN can pipe the n and r from this page into the Password Combination Calculator to size the number of distinct attempts an attacker has to try.

Benefits of Using This Calculator

A short list of what the tool does well helps you put the result in context.

  • n to the r in a single read: The calculator returns the with-replacement count as a single integer, so a homework step or a meeting slide can quote the answer without expanding the product by hand.
  • Multiplication chain alongside the total: The chain row shows the n × n × n × ... product with the factor repeated r times, so the reader can see exactly which factors built the n to the r result.
  • Chain length as a cross-check: The chain length row is just r, but it gives the reader a single number to confirm the chain row was built from the right number of factors.
  • Validation that catches counting problems early: If n or r is negative, or outside the cap, the form surfaces an inline error before the result is reported.
  • Safe results for very large counts: The calculator switches to a digit count and a 16-digit prefix for any result with more than 16 digits, so 2 to the 50 and other astronomical totals stay readable.

Once the with-replacement count is in hand, the Binomial Distribution Calculator uses n to the r as the number of ordered trials so a reader can turn a per-trial success rate into a probability across r independent draws.

Factors That Affect Your Results

The tool is honest about which factors change the n to the r result and which factors the formula does not see at all.

Choice of n and r

n to the r grows quickly with both inputs. Adding one to r multiplies the count by n; adding one to n multiplies the count by n to the r divided by n, so the two inputs pull the total in different directions.

Whether repetition is allowed

The n to the r formula assumes every draw is with replacement. If the problem forbids repeated types, the count is n! / (n - r)! instead.

Whether order matters

Permutation with repetition counts ordered sequences, so ABC and BAC and CBA each count separately. If order is irrelevant but repetition is still allowed, the right unordered count is the combinations-with-repetition formula C(n + r - 1, r) = (n + r - 1)! / (r! * (n - 1)!), not n to the r divided by r!.

Upper bound of n = 99 and r = 50

The caps keep the result inside the safe integer range and keep the multiplication chain readable on one line.

Distinct types at every position

The n to the r formula assumes the same n types are available at every position. A shrinking pool needs a custom product or a recurrence.

  • The calculator assumes every draw is with replacement and the symbol pool is the same at every position. Shrinking pools or banned pairs need a custom product.
  • The result panel shows the total and chain, not a list of every individual sequence.
  • Very large counts beyond 16 digits are shown as a digit count and a 16-digit prefix. The total is still exact, but a quick read is no longer possible.

According to OpenStax Introductory Statistics 2e, Section 3.1, when each of r trials can end in any of n outcomes, the total number of r-tuples is n × n × ... × n, which is n^r

When the with-replacement count is the sample space, the Probability Calculator lets a reader divide the number of favorable outcomes by the n to the r total to read an equally-likely probability for the trial.

Permutation with repetition calculator input form with n=10 and r=4, showing the n to the r total of 10000 alongside the multiplication chain 10 × 10 × 10 × 10 and chain length 4
Permutation with repetition calculator input form with n=10 and r=4, showing the n to the r total of 10000 alongside the multiplication chain 10 × 10 × 10 × 10 and chain length 4

Frequently Asked Questions

Q: What is a permutation with repetition?

A: A permutation with repetition is an ordered sequence of length r drawn from n distinct types when each draw is made with replacement, so the same type can appear in more than one position. The total number of such sequences is n to the r, and the calculator returns that count plus the n × n × n chain and the chain length in one read.

Q: What is the formula for a permutation with repetition?

A: The formula is n to the r, which is n multiplied by itself r times. For n = 10 and r = 4 the chain is 10 × 10 × 10 × 10, the total is 10,000, and the chain length is 4.

Q: How is permutation with repetition different from regular permutation?

A: Regular permutation counts ordered arrangements of distinct items using n! / (n - r)!, which is only defined for r <= n. Permutation with repetition allows the same type to repeat and uses n to the r. The two formulas agree at r = 0 and at r = 1, and they diverge for every other pair where the no-repetition count is defined. When r > n the no-repetition count is undefined, which is one reason n to the r is the right tool whenever the same type can sit in more than one position.

Q: How many 4-digit PINs are possible using 10 digits?

A: A 4-digit PIN from 10 digits has 10 to the 4 = 10,000 possible codes, with chain 10 × 10 × 10 × 10 and chain length 4. Repetition is allowed, so PINs like 1111 and 0000 are counted in the total.

Q: How many 3-letter words can be made from 26 letters with repetition?

A: Including nonsense words like ZZZ, there are 26 to the 3 = 17,576 possible 3-letter words from 26 English letters. The chain is 26 × 26 × 26 and the chain length is 3.

Q: What does n to the r mean in combinatorics?

A: n to the r is the with-replacement count of length-r sequences drawn from a set of n types. It is the multiplicative form of the classical counting rule and is the right tool whenever the same type can sit in more than one position of the sequence.