Calculators
Rencontres Calculator
Calculate exact rencontres numbers: permutations of distinct items with exactly k fixed positions, privately in your browser.
Count permutations of distinct items with exactly k items in their original positions. Enter n and k from 0 to 1000, with k no greater than n. Calculations stay in your browser.
Count permutations with exactly k fixed positions.
The rencontres number R(n, k) counts permutations of n distinct items with exactly k items in their original positions. Choose those positions, then derange all remaining items: R(n, k) = C(n, k) × D(n − k). Use D(0) = 1, D(1) = 0 and D(m) = (m − 1) × (D(m − 1) + D(m − 2)). For n = 5 and k = 2, choose 2 of 5 positions in 10 ways and derange the other 3 in 2 ways, giving 20 permutations. Exactly zero fixed positions gives a derangement; all n fixed positions gives one permutation. Exactly n − 1 fixed positions is impossible for positive n. R(0, 0) = 1 counts the empty permutation. This assumes distinct items and counts exactly k fixed positions, not at least k. Enter whole numbers from 0 to 1000 with k no greater than n. Leading zeros and surrounding whitespace are accepted; signs, decimals and scientific notation are rejected. BigInt arithmetic preserves every digit. Inputs stay in the browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What does a rencontres number count?
Permutations of distinct items with exactly k items staying in their original positions. The formula is C(n, k) × D(n − k).
What is R(5, 2)?
It is 20: choose the two fixed positions in 10 ways and derange the remaining three items in two ways.
Can exactly n − 1 positions be fixed?
For positive n, no. The remaining item cannot move without displacing another item. The result is zero.
What happens at zero or all fixed positions?
Zero fixed positions gives D(n). All positions fixed gives one permutation, including the empty case R(0, 0) = 1.
Are results exact and private?
Yes. Inputs from 0 to 1000 are evaluated using browser BigInt arithmetic, without uploading them.