Lukas' Notes

combinatorics

Definition

Variation with Repetition

A variation with repetition chooses elements from available elements and places them in order. Order matters, and the same element may be chosen more than once.

For a finite set with , it is an ordered tuple

Equivalently, the tuple defines an unrestricted position map

Unlike a variation without repetition, this map need not be injective. The number of variations with repetition is

Derivation from the Product Rule

Construct a variation from left to right, stopping after positions. At every position, all elements remain available because an earlier choice does not remove an element from future choices:

Before position , exactly choices have been made, but repetition keeps every element of legal. The number of choices at position is therefore still .

Every complete variation follows one path through these stages. For and , the complete paths are:

At every level, each partial tuple has exactly two continuations because both and remain available. In general, every level has choices. The product rule therefore gives

Distinction from Permutation with Repetition

Warning

A variation with repetition chooses a value separately for each position, so the resulting multiplicities are not fixed in advance. A permutation with repetition instead starts from a multiset with fixed multiplicities and rearranges all of its occurrences.

Example

Four-digit codes

A four-digit code uses the ten digits . Order matters, repetitions are allowed, and leading zeros are permitted. For example, is valid.

Hence the number of possible codes is