Signore Galilei

Let's Explore!

Blog

Videos

About

A formula for round numbers

A “round number” is a number that you’d round something off to. For example, 100 is very round: it’s intuitive to say that 98 or 103 are both about 100. 17 is not round: if you knew there are 18 people in a room, saying that there are “about 17” is more confusing, not less.

To me, as a math person, this definition is deeply unsatisfying. Using your instinct is fine if you’re trying to actually round something in real life, but math is notably not “real life”. Math is all about finding hidden patterns. Something as basic as rounding should have more logic behind it than “go with your gut”, at least according to my own gut.

So about a year ago, I started a quest to design a formula for how round a number is. I’ve finally cracked it. I think the process is even cooler than the result, so I’ll walk you through it, but if you’re in a hurry, you can skip to the definitions in bold.

Our goal is an objective formula that takes in a number and spits out a “roundness score” that closely matches our intuition. Powers of 10 should be very round. Half powers of 10 (5, 50, 500) should be pretty round, too. 25 and 20 should be somewhat round, and both less round than 50. Prime numbers (other than 2 and 5) should be the least round of all.

And ideally, this would be a numerical score rather than just an ordering. 30 should be more round than 3 by the same amount that 70 is more round than 7.

Binary roundness

Let’s try a standard math approach to make this easier. Can we simplify the problem somehow?

Here’s one way. There’s nothing special about base 10 other than the fact that we use it commonly. A formula for binary round numbers, for instance, might be easier to find. In binary (base 2), each bit (binary digit) can only be a 1 or a 0. 70 looks like this: 1000110. How might our intuition about round numbers translate to binary?

First, powers of 2 replace powers of 10. So 2, 4, 8, and 16 are written as 10, 100, 1000, and 10000 – all clearly very round.

If I had to pick the 2nd roundest 4-bit number, I’d go with 1100 (which is 12 in base 10). Binary numbers seem more round when they have more 0’s on the end compared to the number’s total length.

For binary, that’s enough to find a good formula. For numbers other than powers of 2, use the fraction of the bits that are final 0’s. So 1100 has 2 final 0’s out of 4 bits, making its roundness 2/4 or 0.5. Powers of 2 should be 100% round (1.0), so we should clump them in with numbers having 1 fewer bit. We can condense that into this definition: For a number n, the “binary roundness” of n is the number of final 0’s in the binary representation of n, divided by the number of 0’s in the smallest power of 2 that is at least as large as n.

Back to base 10

Our definition for binary conveniently also works well for other prime bases besides base 2 (replacing powers of 2 with powers of the base we’re using). Eighteen in base 3 is 200, so its roundness is 2/3, which seems plausible.

If we want to use this for base 10 though, how do we account for 5, or 25? We need to generalize our digit counting a bit.

What are we actually doing when we find the number of 0’s at the end of a number n? Well, we’re finding the largest factor of n that is a power of our base. But for 10, factors of 10 like 5 and factors of 100 like 25 are pretty round, too. So maybe we instead need to find the largest factor of n that is a factor of a power of our base.

And how about when we divide by a number of digits? As seen on xkcd’s What If?,1 dealing with the number of digits is a good estimate for a logarithm. So, let’s just use a logarithm!

Here’s a trial definition for base 10: For a number n, find the smallest power of 10 m that’s larger than n, and find the largest factor k of n that’s a factor of a power of 10. The “Base 10 roundness” of n is then logm k.

I like this definition a lot. Powers of 10 are perfectly round (1.0). 25 and 75 are both equally round (~0.7), while 175 is less round (~0.47). 20 and 60 (~0.65) lie in between. Even numbers are more round than odd ones, which also feels right.

Bringing back our gut

Looking at a spreadsheet with this formula, I’ve got one remaining complaint. 28 is more round (~0.3) than 26 (~0.15), since 28 is a multiple of 4 and 26 isn’t. The formula also says that 64 is super round, since it’s a power of 2, but most people would probably disagree (besides computer programmers). Same with multiples of, say, 125. How round is 875 compared to 675? The formula says 875 is rounder, but my gut says they’re the same.

I think our problem here is most people would have trouble remembering all the multiples of 4 less than 100 without dividing – there are just too many of them. Human working memory can hold about 7 numbers at once, so the 4 ways a multiple of 25 can end are fine (00, 25, 50, 75), or the 5 ways a multiple of 2 can end (0, 2, 4, 6, 8), but the 8 endings for multiples of 125 or the 25 endings for multiples of 4 are too much to remember. So, let’s ignore factors that require us to remember 8 or more endings. Here’s our final definition:

For a number n, find the smallest power of 10 m that’s bigger than or equal to n, and find the largest factor k of n that’s a factor of a power of 10 l, such that l/k < 8. The “Base 10 roundness” of n is then logm k.

In general:

For a number n, a base b, and a working memory size c, find the smallest power of b m that’s bigger than or equal to n, and find the largest factor k of n that’s a factor of a power of b l, such that l/k < c. The “Base b roundness” of n is then logm k.

Parting thoughts

This exercise was mostly for fun. You don’t need to pull out your calculator when you’re rounding a tip – that kind of defeats the point of rounding. What I hope you get out of this is that math lets you quantify your gut instincts, and that you can work through that process. by looking at similar problems and working your way up. I also hope this was a good workout for your brain – there’s a lot to be said for recreational math.

You can find a table with the formula here.

Coming soon: Eating bear fat with honey and salt flakes

 

 

Bonus: some worked examples

After this post was published, a few people asked me to add a worked example for a specific number.  We’ll do 2 to contrast them: 75 and 76.  (This part doesn’t count toward the word count for Inkhaven, but I hit the total without it.  I hope this isn’t too against the spirit of things.)

First, n=75.  m, will be the smallest power of 10 that is larger than or equal to 75, so m=100.  To find k, first find the biggest factor of 75 that’s a factor of a power of 10 (i.e, that’s a multiple of only 2’s and 5’s).  That’s 25, which is a factor of 100.  So we get log100 (25) 0.699 as our final answer.

Next, let’s try n=76.  Again, m is 100, since that’s the smallest power of 10 larger than or equal 76.  The largest factor of 76 that’s also a factor of a power of 10 is 4, which is a factor of 100.  But 100/4 = 25, and 25 is not less than 8; we can’t remember 25 different endings for multiples of 4.  So instead we have to use a smaller k.  The next largest factor of 76 that’s also a factor of a power of 10 is 2, which is a factor 10.  Since 10/2=5, and 5<8, we will use k=2.  Then we get log10 (2) ≈ 0.151 as our roundness for 76.

Leave a Reply to gggCancel reply

  1. Adrià Garriga Alonso Avatar

    Very cool formula! I want to start printing all the uncertain small numbers in my computer programs like this.

  2. ggg Avatar
    ggg


    This was cool. LaTeX would have been appreciated over italics.

  3. AprilSR Avatar

    Hello Signore Galilei! Your post made me realize that I have a very weird taste in which numbers I feel to be round, and since I am trying to do the “pirate Inkhaven” challenge I wrote a post about it, which I figured you might like to hear about.

    It was neat when I realized that someone who made a few YouTube videos I’d watched was participating in Inkhaven! Good luck with it, excited to see the rest of your blogging!

    1. signoregalilei Avatar

      Hello! Thanks for sharing this with me, I found it really neat to see your perspective. I’m going to leave a more detailed comment on your post.

  4. koreindian Avatar

    Hm! I noticed something funny about the “sharp numbers” of roundness 0. I believe that any even number greater than two can be written as the sum of two sharp numbers, but I can’t quite prove it. Any tips?

    1. signoregalilei Avatar

      I think the work of one C. Goldbach may help (lol).

      More seriously, this problem is a bit easier because e.g. 9 or 33 have roundness 0. Also, 2 and 5 have nonzero roundness, so I actually think you cannot make 4 or 8.

Discover more from Signore Galilei

Subscribe now to keep reading and get access to the full archive.

Continue reading