Derangement and z-Transform
Let’s explore an interesting application of z-transform: solving the classical derangement probability. This problem is often put as the probability that no one gets their own hat, suppose we randomly distribute $n$ hats to $n$ people. Introduction The derangement problem is a classic combinatorial problem. Given $n$ distinct items, a derangement is a permutation of these elements, such that no item appears in its original position. For example, let’s consider 3 items $(A, B, C)$....