• xthexder@l.sw0.com
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    5
    ·
    8 months ago

    Turns out that’s not possible because the complexity of computing pi becomes exponentially harder the more digits you add.

      • jadero@mander.xyz
        link
        fedilink
        English
        arrow-up
        7
        ·
        8 months ago

        There was a recent post asking what the self-taught among us feel we are missing from our knowledge base. For me, it’s being able to calculate stuff like that for making decisions. I feel like I can spot an equivalence to the travelling salesman problem or to the halting problem a mile away, but anything more subtle is beyond me.

        Of course, in this situation, I’d probably just see if I could find a sufficiently large precalculation and just pretend :)

      • xthexder@l.sw0.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        8 months ago

        Okay, maybe exponential is the wrong math term, but my point is, the complexity grows with number of digits. Infinite scrolling is therefore impossible because eventually it will become too slow to keep up with scrolling. You may be right that it may go farther than any human is willing to scroll, but that depends on the human and if they’re on a potato phone.

        As far as I know, the current fastest algorithm is the Bailey–Borwein–Plouffe formula, which is O(n log n) to calculate the nth digit (not even the whole number). Infinite scrolling is only possible if we can calculate the nth digit in O(1) time.