Permutations with repetitions

  • Context: Graduate 
  • Thread starter Thread starter vanesch
  • Start date Start date
  • Tags Tags
    Permutations
Click For Summary
SUMMARY

The discussion centers on calculating the number of permutations with repetition from a set of cardinality k, drawn from a set with n elements, containing exactly l different elements, denoted as Z_{k,n}^l. A recursive definition is provided: Z_{k,n}^l = Z_{k-1,n}^l.l + Z_{k-1,n}^{(l-1)}.(n-l+1), along with boundary conditions Z_{k,n}^k = P^n_k = n!/(n-k)! and Z_{k,n}^1 = n. The author, Patrick, successfully implements this recursion in Mathematica and confirms the results align with the expected outcomes. However, he expresses frustration at the lack of a closed-form expression for this calculation, which he believes should exist.

PREREQUISITES
  • Understanding of permutations and combinations
  • Familiarity with recursive functions
  • Knowledge of Mathematica for programming mathematical functions
  • Basic concepts of set theory and cardinality
NEXT STEPS
  • Research closed-form expressions for permutations with repetition
  • Explore advanced combinatorial techniques in discrete mathematics
  • Learn about generating functions and their applications in combinatorics
  • Investigate the use of Mathematica for combinatorial problems
USEFUL FOR

Mathematicians, computer scientists, and students studying combinatorial mathematics or programming recursive algorithms in Mathematica.

vanesch
Staff Emeritus
Science Advisor
Gold Member
Messages
5,115
Reaction score
20
Hi all,

I have a question, which I would have thought has been resolved already since a few centuries, but I can't find anything on it. I'm looking for the following quantity: the number of permutations with repetition of a set of cardinality k, drawn from a set with n elements, of which there are exactly l elements different. I call that number, Z_{k,n}^l (I haven't found any standard notation for it).

Now, I've found a recursive definition for Z:
Z_{k,n}^l = Z_{k-1,n}^l.l + Z_{k-1,n}^{(l-1)}.(n-l+1)

and boundary conditions:
Z_{k,n}^k = P^n_k = \frac{n!}{(n-k)!}

(indeed, a permutation of k elements out of n, with repetition, but of which there are k different elements, is simply a permutation without repetition)

and:
Z_{k,n}^1 = n

(indeed, if there is only one "different" element, all k elements drawn are the same, and hence there are exactly n possibilities: they are all equal to the first of the n elements, or to the second, or...)

The recursion relation has been found by considering (k-1) elements drawn, and by adding the k-th element. The first term corresponds to the case where the k-1 elements already have l different elements in them, so the k-th one must be one of them, while the second term corresponds to the case where the k-1 elements have only l-1 different elements in them, so the k-th element must be distinct.

The recursion + boundary conditions are complete, I can program them in Mathematica, and seem to obtain good results.

We have of course that \sum_{l=1}^k Z_{k,n}^l = n^k, as the sum over all possible numbers of different elements comes down to picking all possible permutations with repetition.

But I would have expected this problem to have been solved already some centuries ago, with some explicit, closed-form expression, which I can't find.

Anybody any suggestion?
thanks,
Patrick.
 
Last edited:
Physics news on Phys.org

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 29 ·
Replies
29
Views
6K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
3K