This problem is called birthday paradox. It is acutally a very interesting problem. In a group of $23$ people the probability that two of them will have exactly the same birthday is one half. If you think that there are $365$ days and $23$ people such a probability $p=0.5$ sounds a bit high perhaps.. though it is the probability..
There is also a very good exponential approximation to the problem. This problem is taught in cryptography lectures as it is important to know the probability of collisions if one wants to design some hash functions.
For more informations I think wiki will be quite enough:
http://en.wikipedia.org/wiki/Birthday_problem
What Wiki says about hash functions (if interesting):
In an ideal "perfect hash function", no bucket should have more than one record; but a small number of collisions is virtually inevitable, even if n is much larger than m – see the birthday paradox).