
▲ 8 r/matiks
A fun challenge for everybody
Take natural a,b,c,d < 1000. The algorithm for comparing non-obvious logarithms loga(b) and logc(d) is the following:
- If b>a and d>c, replace loga(b) and logc(d) with loga(b/a) and logc(d/c) respectively
- If b<a and d<c, replace loga(b) and logc(d) with logd(c) and logb(a) respectively
- If none are true, then one of the logarithms is greater or equal to 1, and another is smaller or equal to 1, which allows you to compare them. Turns out, this comparison is also true for the original true logarithms
Your task is to
- Prove that this algorithm actually works (i.e the sign of <, = or > at the end of the algorithm will be true for the logarithms at the beginning)
- Find such a,b,c,d that the algorithm runs the largest amount of steps without looping
- Find such a,b,c,d that the algorithm runs the largest amount of steps without looping, but for compartisons we use >= and <= instead of the strict > and <
If you're too lazy to try and figure that out, here're my answers (maybe you can beat them, I am not certain)
2: >!a = 927 b=168 c = 905 d = 165 the algorithm runs for 74214 steps!<
3: >!a = 908 b = 426 c = 512 d = 256 the algorithm runs for 829490 steps!<
u/Correct-Pangolin-568 — 14 hours ago