3 ms·
Two's complement unexpectedly shows up in infinite series
- pfortuny 4y agoThat is what happens when you play with divergent series… Fun stuff but not easy to explain (if at all).
- suremarc 4y agoThe infinite sum involving powers of two is actually true in the 2-adic integers.
- solresol 4y agoAnd any of his other examples would work with powers-of-p if p is prime. Those infinite series aren't divergent if you are measuring their size p-adically. Gouvea's book actually goes through the things that RobAlni has just discovered.
- kevinventullo 4y agoYep, and that last number is the 2-adic representation of -4/3. It turns out a lot of ideas from calculus and real analysis carry over to the 2-adics, and this can lead to some interesting computational shortcuts since two’s complement is essentially native 2-adic arithmetic. I’ve blogged a bit about this here: https://kevinventullo.com/ https://kevinventullo.com/
- boonsuan 4y agocheck out https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adic/ https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adi... for a discussion of some relevant mathematics; cool stuff there is also a lot of good stuff concerning such computational tricks and their relation with 2-adics in section 7.1.3 (Bitwise Tricks and Techniques) of volume 4A of The Art of Computer Programming: https://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz https://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz