follows: >50% probability of 3 people sharing a birthday - 88 people; >50% probability of 4 people sharing a birthday - 187 people . Probability of a shared birthday (collision) The birthday problem can be generalized as follows: Given random integers drawn from a discrete uniform distribution with range , what is the probability that at least two numbers are the same? ( gives the usual birthday problem.) The generic results can be derived using the same arguments given above. Conversely, if denotes the number of random integers drawn from to obtain a probability that at least two numbers are the same, then The birthday problem in this more generic sense applies to hash functions: the expected number of -bit hashes that can be generated before getting a collision is not , but rather only . This is exploited by birthday attacks on cryptographic hash functions and is the reason why a small number of collisions in a hash table are, for all practical purposes, inevitable. The theory behind the birthday problem was used by Zoe Schnabel under the name of capture-recapture statistics to estimate the size of fish population in lakes. Generalization to multiple types of people The basic problem considers all trials to be of one "type". The birthday problem has been generalized to consider an arbitrary number of types. In the simplest extension there are two types of people, say men and women, and the problem becomes characterizing the probability of a shared birthday between at least one man and one woman. (Shared birthdays between two men or two women do not count.) The probability of no shared birthdays here is where and are Stirling numbers of the second kind. Consequently, the desired probability is . This variation of the birthday problem is interesting because there is not a unique solution for the total number of people . For example, the usual 50% probability value is realized for both a 32-member group of 16 men and 16 women and a 49-member group of 43 women and 6 men. Other birthday problems First match A related question is, as people enter a room one at a time, which one is most likely to be the first to have the same birthday as someone already in the room? That is, for what is maximum? The answer is 20—if there is a prize for first match, the best position in