I tried programming this idea very briefly a couple years ago but I got pulled away for something else.
I tried programming this idea very briefly a couple years ago but I got pulled away for something else.
julia> setprecision(BigFloat, 10_000) do
findfirst("123","$(BigFloat(pi)))")
end
1926:1928
I.e. the string "123" starts at index 1926.On the other hand, this type of "encoding" always fun to think about. I would suggest reading "Permutation City" by Greg Egan if you are amused by this.
Assuming optimal conditions (i.e. optimal randomness), you can expect that as many pieces of data will have pointers smaller than them, as pointers bigger than them; you can't win that way necessarily, only in some cases.
But maybe if you can find two 'opposite' algorithms, such that for any data where the pointer is larger with the first, it's smaller in the second...
(From what I know of information theory, the extra bit you have to use to specify which algorithm to use will outweigh all savings, but it's still fun to think about.)
> After returning to Zenon (or wherever), the alien precisely measures the marked rod, obtains lengths A and B, and divides A/B to yield the original integer, which a computer decodes to print out the Encyclopedia.
- Dr Dobb's