Monday, July 2, 2018

Billions and Billions and Billions of numbers...

So a week or so ago, someone got access to one of my credit card numbers and started buying things at the iTunes store. Capital One was on the job and immediately sent me text messages and emails asking "Is this you?" When I said "NO!" and submitted a fraud report they immediately canceled that card and got the charges rescinded and then within about 15 minutes they got me a new credit card number and said they'd be mailing me the new card (it arrived about 3 days later).  This is all very cool. It was a bit inconvenient because this particular card was the one I used for all my Internet purchases (I use a different card for non-internet stuff), but eventually I got it all straightened out.

But then I started thinking about Capital One and how many new cards - and card numbers - they must generate in a single day. I also started wondering about how many credit card numbers there were and when they'd run out of numbers (like the IPv4 internet addresses - there are only 4 billion of them and we actually ran out several years ago, hence IPv6). Clearly the credit card companies don't re-use credit card numbers. Also clearly there are a finite supply of them. So eventually we'll run out right? Well, here's the math...

All the credit cards I have and know about use 16-digits for your credit card number, plus you also have a security code of either 3 or 4 digits. The security code doesn't enter into this computation, though. So with 16 digits that is 10^16 possible credit card numbers - 10,000,000,000,000,000 possibilities. Also remember that there are about 7 billion people on the planet.

Now if all the credit card companies give out 1 million (10^6) new credit cards a day, that's 365 million a year. It will take about 3 years to get to a billion numbers (10^9), and 3000 years to get to a trillion (10^12), and 3 million years to get to a quadrillion (10^15). So I think we're good for a while.

But, a million numbers a day divided up between 7 billion people doesn't sound like very many. What if the credit card companies gave out 1 billion (10^9) new credit card numbers a day? Well, doing the same math we get 365 billion numbers per year. I will take 3 years to get to a trillion numbers (10^12) and 3000 years to get to a quadrillion (10^15) and 30,000 years to get to 10^16. So even if every person on the planet gets a new credit card every week we're still good for about 30,000 years. I'm happy.

But wait. There are other numbers. Your Social Security Number is only 9 digits long, which means there are only a maximum of 1 billion (10^9) possible numbers. There are currently about 325 million Americans with Social Security numbers, not counting all the dead people who had SSNs. So aren't we going to be running out of SSNs real soon now?

It turns out yes, and no. There's a great answer to this question on Quora that says that we've only used about 480 million of the billion possible numbers (there are actually fewer because some are excluded, like 000-00-0000 and 999-99-9999) and we're using them up at the rate of about 5.5 million a year. At that rate we'll use them all up in about 95 more years and we'll then have to either increase the length of your SSN, add a letter, or start reusing dead people's numbers. In 95 years I'd be over 150 years old, so I don't think I have to worry.