Pi and Permutations
Yesterday I wrote a blog post explaining how to compute the nth hexidecimal digit of π directly without having to compute the previous digits. This is an example of a so-called spigot algorithm.
It’s well known that the BBP formula lets you do this, but it’s hard to find a detailed explanation of how it lets you do this.
I explain how, implement the algorithm in Python, and find the billionth hex decimal of π.
Today I wrote a post looking at the following question. If you randomly permute the numbers 1, 2, 3, …, n + 1, how likely is it that no two numbers are consecutive?
The post gives a way to calculate the probability for given n and speculates that in the limit as n increases the probability converges to 1/e.