News for hackers. Stuff that matters.
Re:Powers of Two in Lexicographic Order by btilly on Monday July 29, 2019 @06:31PM (#20560160)
Cute.

For any numbers m and n, if m^x/n^y is close to but not the same as 1, this same procedure in base m will make the normalized and resorted values of 1, n, n^2, ... n^y be close to 1, m^(1/y), m^(2/y), ... m^((y-1)/y).

That is because n is approximately m^(y/x). n^2 is approximately m^(2y/x) and so on. Every time the fraction goes past 1, we rollover, and the result is that this table gets filled in with good approximations for, in this case, entries 0, 3, 6, 9, 2, 5, 8, 1, 4, 7 and then we'd roll over to 10 and be close to the starting entry for 0 (namely 1.0). And if you order by the percentage error in the approximations, you'll find that they get steadily worse as you go down that sequence.

In the case of 10 and 2 it is particularly good because 2^10 is very close to 10^3. However 3^2 = 9 is close to 10^2, 3^19 = 1162261467 is close to 10^9, 5^10 = 9765625 is close to 10^7, and 7^13 = 96889010407 is close to 10^11. All of these will produce similar tables.

The approximation will be most startling for 5^10 and 2^10, followed by 7^13. And it all has to do with how close m^x/n^y is to 1.0.

Re:Powers of Two in Lexicographic Order by ColinWright on Monday July 29, 2019 @08:29PM (#20560971)
All of this is true, and helps to see what's happening as we analyse the numbers and try to create new examples, but I'm trying to find a way to explain this to non-math people. With the replies I'm getting I think I'm getting close to a couple of explanations that I can use, but it's surprisingly tricky.

What's more tricky, I find, is communicating to people what I'm trying to achieve. I found the same problem with the "photocopy a mirror" problem, and the "Four Points, Two Distances" problem. It's not a question of doing the sums, it's a problem of making the structure of the solution accessible.

But in this case I think I'm getting there.

Re:Powers of Two in Lexicographic Order by btilly on Monday July 29, 2019 @09:03PM (#20561145)
Is it not simply a question of saying that 2^10 = 1024 is close to 10^3 - 1000. Take 10th roots of both sides and 10^(3/10) = 1.995262... is close to 2.

And therefore we have 1 = 10^0, 2 ≈ 10^0.3, 4 ≈ 10^0.6, 8 ≈ 10^0.9, 16 ≈ 10^1.2, 32 ≈ 10^1.5, 64 ≈ 10^1.8, 128 ≈ 10^2.1, 256 ≈ 10^2.4, and 512 ≈ 10^2.7.

Divide by 10s and we get 1 = 10^0, 2 ≈ 10^0.3, 4 ≈ 10^0.6, 8 ≈ 10^0.9, 1.6 ≈ 10^0.2, 3.2 ≈ 10^0.5, 6.4 ≈ 10^0.8, 1.28 ≈ 10^0.1, 2.56 ≈ 10^0.4, and 5.12 ≈ 10^0.7.

Reorder and we've got the initially surprising 1 = 10^0, 1.28 ≈ 10^0.1, 1.6 ≈ 10^0.2, 2 ≈ 10^0.3, 2.56 ≈ 10^0.4, 3.2 ≈ 10^0.5, 4 ≈ 10^0.6, 5.12 ≈ 10^0.7, 6.4 ≈ 10^0.8 and 8 ≈ 10^0.9.

Then work the 5^10 and 7^13 examples to show that it happens whenever a^b is close to a power of 10.

Leave out the other base observation.