Do not forget the choice
transcript
Re-slot four products. Exactly one stays in its bin. How many ways?
Count only the products that move. Three of them, with no fixed point: two. But any of the four could stay. So multiply by four: eight.
First choose who stays. Then rearrange the others. Multiply the two counts.
Choose the staying products: C of n and s. Rearrange the others with no fixed point. Multiply, and take it modulo the prime.
Five products, two staying: ten choices. The other three have two arrangements. So the total is twenty.
Test zero staying products. Test all products staying. Compare with a brute force list.
Write a slow twin that lists every arrangement. It counts those with exactly s fixed bins. Compare both for every n up to seven.
A hundred thousand products give astronomical counts. So take every count modulo a prime. A division becomes an inverse.
Choose who stays. Then rearrange the rest. Full breakdown in the lecture.