# qdd

Could you use a URL shortening service like bit.ly or goo.gl to effectively assign a URL to every atom in the known, observable universe?

According to Universe Today we can put an upper bound on the number of stars at $3.0 \times 10^{23}$, with the upper bound on the number of atoms at a staggering $10^{82}$.

While I couldn't find hard numbers, 30 seconds on StackOverflow provides anecdotal evidence that both bit.ly and goo.gl don't directly limit their URL lengths. So we'll assume that they are restricted externally by what browsers can handle.

The maximum “safe” URL length was studied and documented by the researchers at boutell.com to be roughly 2,000 characters in most modern browsers. Removing the characters “http://bit.ly/" or “http://goo.gl/" gets us to 1,987 characters.

The last piece of data we need is the size of the alphabet used to encode short URLs. Simple logic (and Wikipedia) dictates that most shortening services use a combination of lowercase, uppercase, and digits for a total alphabet size of 62.

Now we can do maths! Actually, very simple maths too. This just turns into a base conversion from base-10 to base-62 for the number of “things” we're interested in, bounded by 1,987. It turns out that we only actually need $\left\lceil\frac{\log(10^{82})}{\log(62)}\right\rceil = 46$ characters! Adding the obligatory protocol and domain information back in we finish at 59 characters, well below our maximum URL size. (Actually, we have a TON of room left over, we should find more universe!)

So yes, bit.ly and goo.gl could actually provide a URL for every atom in the known, observable universe. We may continue on, knowing that regardless of how many lolcats pictures are posted, we will always be able to share them on Twitter.

If you like this sort of thing (using math to answer weird questions), then you should check out the XKCD what-if site. It's one of my favorites, and definitely served as inspiration for this post.