How can you calculate the number of partial derangements of a multiset? For example, if I have the multiset {green, blue, blue, green, green, green, red, blue, red} and I want to find all derangements where 4 elements have not moved (4 fixed points) and $9-4=5$ elements have moved, I listed all of them and found there were 264 total. I found these links helpful:
- The number of partial derangements of a $52$-card deck (ignoring suits)
- Derangements of multisets
- https://sites.math.rutgers.edu/~zeilberg/mamarim/mamarimPDF/multider.pdf
- Partial Derangement formula for permutation with repeated elements
How can I enumerate multiset partial derangements?
This would be a fully general form of partial derangements.