r/ProgrammerHumor • • 18d ago

Meme reversingPiInPython

Post image
14k Upvotes

383 comments sorted by

View all comments

Show parent comment

1

u/meneldal2 15d ago

So the chance is actually much higher than your formula because you only care about one half of the digits

My sum is basically counting the expected number by adding the probability for each n. That kind of stuff works for like prime numbers, we know the probability depends on the log of the number, and that sum does go to infinity.

Here it is trivial to prove the sum is finite. Sum of 1/n is infinite, but something like 1/n2 is famously pi/6. You can write the sum I talked about as sum n=1 to infinity 2*10^(-n) which is well 2/9 or 0.2 repeating.