is more likely than not that two of them will have a birthday within a week of each other. Number of days with a certain number of birthdays Number of days with at least one birthday The expected number of different birthdays, i.e. the number of days that are at least one person's birthday, is: This follows from the expected number of days that are no one's birthday: which follows from the probability that a particular day is no one's birthday, , easily summed because of the linearity of the expected value. For instance, with = 365, you should expect about 21 different birthdays when there are 22 people, or 46 different birthdays when there are 50 people. When there are 1000 people, there will be around 341 different birthdays (24 unclaimed birthdays). Number of days with at least two birthdays The above can be generalized from the distribution of the number of people with their birthday on any particular day, which is a Binomial distribution with probability . Multiplying the relevant probability by will then give the expected number of days. For example, the expected number of days which are shared; i.e. which are at least two (i.e. not zero and not one) people's birthday is: Number of people who repeat a birthday The probability that the th integer randomly chosen from will repeat at least one previous choice equals above. The expected total number of times a selection will repeat a previous selection as such integers are chosen equals This can be seen to equal the number of people minus the expected number of different birthdays. Average number of people to get at least one shared birthday In an alternative formulation of the birthday problem, one asks the average number of people required to find a pair with the same birthday. If we consider the probability function Pr[ people have at least one shared birthday], this average is determining the mean of the distribution, as opposed to the customary formulation, which asks for the median. The problem is relevant to several hashing algorithms analyzed by Donald Knuth in his book The Art of Computer Programming. It may be shown that if one samples uniformly, with replacement, from a population of size , the number of trials required for the first repeated sampling of some individual has expected value , where The function has been studied by Srinivasa Ramanujan