Course contentsShow
← Computer Science
Lesson 101 of 2,8722. Discrete Mathematics for CSFree lesson

Permutations with Repetition

Calculate arrangements when objects can repeat using the formula n^r for r positions with n choices each.

Permutations with Repetition

What You'll Learn

You'll learn how to count arrangements when the same item can be used multiple times in different positions.

The Core Idea

In permutations without repetition (which you've already learned), once you use an object, it's gone—you can't reuse it. But what if you're creating a 4-digit PIN code? Each digit can be 0–9, and you can repeat digits. The first position has 10 choices, the second also has 10 choices (repetition allowed!), the third has 10, and the fourth has 10.

Using the product rule: 10 × 10 × 10 × 10 = 10,000 possible PINs.

This pattern generalizes to the formula for permutations with repetition:

n^r

Where:

  • n = number of choices available for each position
  • r = number of positions to fill

Why It's Different

Without repetition, each choice reduces your options (factorial-based). With repetition, every position independently has all n choices available, so you multiply n by itself r times.

Examples

  • License plates with 3 letters (A–Z): 26³ = 17,576 combinations
  • Binary strings of length 5: 2⁵ = 32 strings (each position: 0 or 1)
  • Passwords with 8 characters from 62 options (a-z, A-Z, 0-9): 62⁸ ≈ 218 trillion possibilities

Analogy

Think of a combination lock with 3 dials, each showing digits 0–9. You're not "using up" a digit when you set the first dial—all 10 digits are still available for the second and third dials. That's repetition.

Key Takeaway: When arranging r items where each position has n independent choices (repetition allowed), use n^r to count total arrangements.