# In a set of 10 billion possible items, if I have X items what is the probability of two being the same? [duplicate]

## marked as duplicate by Michael Chernick, whuber♦ probability StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 6 at 21:30
• If you want to find out of $10^9$ how many you need to pick to make the probability of collision 50%, you can use the formula (given on the Wikipedia page) $n(p; d)\approx\sqrt{2d\cdot\ln\left(\frac{1}{1 - p}\right)}$. Since $n(0.5; 10^9) \approx 37233$, there will be a 50% probability of collision when you have around 37233 items. – leekaiinthesky Feb 8 at 20:17