• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Make Truncation be Rounding

    May 22nd, 2016
    ideas, math  [html]
    When I see a number like "183" the first thing I see is a "1". If I'm looking very quickly, perhaps scanning a column of numbers, that might be all I see, and I'll approximate this number as "100" when "200" would be closer. Yes, truncation isn't the same thing as rounding, but wouldn't things be a lot easier if it were? Let's make it be that way.

    To interpret a number today, you multiply each column by the size it represents and add them up:

    number 100s 10s 1s sum
    100 1 0 0 1*100 + 0*10 + 0*1
    120 1 2 0 1*100 + 2*10 + 0*1
    121 1 2 1 1*100 + 2*10 + 1*1
    129 1 2 9 1*100 + 2*10 + 9*1
    125 1 2 5 1*100 + 2*10 + 5*1

    With this new system, we still do this, but in each column our available options range from -5 to 4 instead of 0 to 9.

    number 100s 10s 1s sum
    100 1 0 0 1*100 + 0*10 + 0*1
    120 1 2 0 1*100 + 2*10 + 0*1
    121 1 2 1 1*100 + 2*10 + 1*1
    129 1 3 -1 1*100 + 3*10 + -1*1
    125 1 3 -5 1*100 + 3*10 + -5*1

    Here are a few more examples:

    old notation new notation
    0 0
    4 4
    7 1-3
    579 1-4-2-1
    432 432
    1999 200-1

    And here's a program to calculate these:

    def to_new_notation(x):
      digits = []
      carry = False
      for digit in reversed([
            int(x) for x in str(x)]):
        if carry:
          digit += 1
          carry = False
    
        if digit >= 5:
          digit -= 10
          carry = True
    
        digits.append(digit)
    
      if carry:
        digits.append(1)
    
      digits.reverse()
      return digits
    

    Update 2016-05-25: Truncation isn't actually rounding in this system unless you allow both 5 and -5 as digits. Thanks to Marius for pointing this out.

    Comment via: google plus, facebook

    Recent posts on blogs I like:

    Governance in Rich Liberal American Cities

    Matt Yglesias has a blog post called Make Blue America Great Again, about governance in rich liberal states like New York and California. He talks about various good government issues, and he pays a lot of attention specifically to TransitMatters and our …

    via Pedestrian Observations November 19, 2020

    Collections: Why Military History?

    This week, I want to talk about the discipline of military history: what it is, why it is important and how I see my own place within it. This is going to be a bit of an unusual collections post as it is less about the past itself and more about how we st…

    via A Collection of Unmitigated Pedantry November 13, 2020

    Misalignment and misuse: whose values are manifest?

    Crossposted from world spirit sock puppet. AI related disasters are often categorized as involving misaligned AI, or misuse, or accident. Where: misuse means the bad outcomes were wanted by the people involved, misalignment means the bad outcomes were wan…

    via Meteuphoric November 13, 2020

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact