lukewarm_ozone@lemmy.todaytoAsklemmy@lemmy.ml•Since Pi is infinite and non-repeating, would that mean any finite sequence of non-repeating numbers should appear somewhere in Pi?English
10·
2 days agoYou generate it when needed, using one of the known sequences that converges to π. As a simple example, the pi()
recipe here shows how to compute π to arbitrary precision. For an application like pifs you can do even better and use the BBP formula which lets you directly calculate a specific hexadecimal digit of π.
Yes.
Sure. It’ll take a very long while though. We can estimate roughly how long - encoded as ASCII and translated to hex your sentence looks like
54686520636174206973206261636b
. That’s 30 hexadecimal digits. So very roughly, one of each16^30
30-digit sequences will match this one. So on average, you’d need to look about16^30 * 30 ≈ 4e37
digits into π to find a sequence matching this one. For comparison, something on the order of 1e15 digits of pi were ever calculated.Not very quickly, it’s still
n log n
time. More importantly, information theory is ruthless: there exist no compression algorithms that have on average a >1 compression coefficient for arbitrary data. So if you tried to use π as compression, the offsets you get would on average be larger than the data you are compressing. For example, your data here can be written written as 30 hexadecimal digits, but the offset into pi would be on the order of 4e37, which takes ~90 hexadecimal digits to write down.