English

Ranking and Unranking Restricted Permutations

Combinatorics 2025-09-30 v2

Abstract

We discuss efficient methods for unranking derangements and m\'enage permutations. That is, we will provide an algorithm to efficiently extract the kk-th earliest such permutation under the lexicographic ordering. We will show that this problem can be reduced to the problem of computing the number of restricted permutations with a given prefix, and then we will use rook theory to solve this counting problem. This has applications to combinatorics, probability, statistics, and modeling.

Keywords

Cite

@article{arxiv.2210.17021,
  title  = {Ranking and Unranking Restricted Permutations},
  author = {Peter Kagey},
  journal= {arXiv preprint arXiv:2210.17021},
  year   = {2025}
}
R2 v1 2026-06-28T04:48:51.646Z