Использование функции Ackermann?

С другой стороны, можно добавить его к URL и позволить языку сценариев (PHP, Perl, ASP, Python, Ruby, безотносительно) обрабатывают его с другой стороны. Что-то как:

var x = 10;
window.open('mypage.php?x='+x);
10
задан MoveFast 28 March 2013 в 10:15
поделиться

3 ответа

Yes. The (inverse) Ackermann function appears in complexity analysis of algorithms. When it does, it means you can almost ignore that term since it grows so slowly (a lot like log(log ... log(n)...)) i.e. lg*(n). For example: Minimum Spanning Trees (also here) and Disjoint Set forest construction.

Also: Davenport-Scinzel sequences

16
ответ дан 3 December 2019 в 15:22
поделиться

I agree with the other answer (by wrang-wrang) "in theory".

In practice Ackerman is not too useful, because in practice the only algorithm complexities you tend to encounter involve 1, N, N^2, N^3, and each of those multipled by logN. (And since logN is never more than 64, it's effectively a constant term anyway.)

The point being, "in practice", unless your algorithm complexity is "N times too big", you don't care about complexity, because real-world factors will dominate. (A function that executes in O(inverse-Ackermann) is theoretically better than a function that executes in O(logN) time, but in practice, you'll measure the two actual implementations against real-world data and select whichever actually performs better. In contrast, complexity theory does "matter in practice" for e.g. N versus N^2, where the algorithmic complexity effects do in fact overpower any "real world" effects. I find that "N" is the smallest measure that matters in practice.)

3
ответ дан 3 December 2019 в 15:22
поделиться

Первоначальное «использование» функции Аккермана состояло в том, чтобы показать, что существуют функции, которые не являются примитивно рекурсивными, то есть которые нельзя вычислить, используя только циклы for с заранее определенными верхними пределами.

Функция Аккермана является такой функцией, она растет слишком быстро, чтобы быть примитивно рекурсивной.

Я не думаю, что есть действительно практическое применение, она растет слишком быстро, чтобы быть полезной. Вы даже не можете явно представить числа за пределами (4,3) в разумном пространстве.

10
ответ дан 3 December 2019 в 15:22
поделиться
Другие вопросы по тегам:

Похожие вопросы: