One of the classic problems in probability theory is the “matching problem,” which is often presented as: A group of men at a party throw their hats into the middle of a room, and at the end of the party each man selects a hat at random before they leave. What is the probability that everyone gets the right hat, or that nobody does, or that at least one person does, and what is the average numb...