• cobysev@lemmy.world
    link
    fedilink
    English
    arrow-up
    36
    ·
    13 hours ago

    Lots of good explanations here, but one thing I’d like to clarify. WHY we add digits together to represent larger numbers. Understanding this helped me to count in binary when I was a young IT technician.

    In base 10, we have 10 numbers we use to count everything, each represented by a single digit 0-9. There is no single digit to represent the number 10, so we add a digit to the left and start over at 0 on the right. Hence, the number 10. Then 11-19 in serial.

    But we’ve run out of digits to use again. So we add another digit to the left and start over on the right. Thus, 20.

    When you get to 100, you’re now starting over at the right-most digit and have to fill up both right digits before the left digit moves up one.

    Same goes for binary, where the only two digits are 0 and 1. Once you’ve counted to one, you’ve run out of digits to use, so you add a 1 to the left and start over on the right. So 2 is written as 10 in binary. Then 3 is 11. Then you’ve run out of digits again, so you add another one to the far left and start over. 4 is 100. 5 is 101. 6 is 110. 7 is 111. No more space, so add another 1 to the left and start over. 8 is 1000. 9 is 1001. 10 is 1010. 11 is 1011. 12 is 1100. And so on…

    With computers, we sometimes use a hexadecimal numbering system, also known as base 16 (hex = 6, deca = 10). In this case, we need 16 unique digits before we start reusing them. So we borrow from the alphabet. We use 0-9, then go through A-F before we add a 1 to the left and start over at 0.

    You can literally create a base-anything and use that to count numbers. Once you figure out how we add digits to count, it’s super easy!

    • SmokeyDope@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      11 minutes ago

      My favorite reference for what youve just described is 3blue1browns Binary, Hanoi, and sierpinski which is both fascinating and super acessable for the average non-nerd.

      The pressing point is that this method of counting isn’t just a good way of doing it, but basically the most efficient way that it can be done. There are no simpler or more efficient ways of counting.

      This allows the same ‘steps’ to show up in other unexpected areas that ask questions about the most efficient process to do a thing. This allows you to map the same binary counting pattern across both infinite paths of fractal geometry with sierpinskis arrowhead curve and solve logic problems like towers of Hanoi stacking. Its wild to think that on some abstract level these are all more or less equal processes.

    • elaiden@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      31 minutes ago

      Really good explanation. Always thought I had a general grasp of both binary and hexadecimal, but never really bothered to truly understand. Now I do from 1 minute of reading a comment. Thanks!