A well-defined total function which is computable but not primitive recursive. It grows faster than an exponential function, or even a multiple exponential function.
Questions tagged [ackermann]
55 questions
3
votes
0 answers
Ackermann function over the real numbers?
I was thinking about the Ackermann function, and whether or not it is possible to extend this function over the positive real numbers in Python.
def naive_ackermann(m, n):
calls = 0
calls += 1
if m == 0:
return n + 1
elif n…

Number File
- 197
- 1
- 6
3
votes
0 answers
Finding Largest Values for (N) in Ackermann Function
In C, I have implemented the Ackermann function but am now attempting to find largest values for N. For example, if m = 1 find the largest value of n that computes correctly. So far I have been using "guess and check" but it seems there has to be a…

Jester Jeffrey
- 115
- 7
2
votes
2 answers
How to check Stack Usage when Calculating Ackermann
I'm learning about my system's ability to calculate Ackermann's algorithm both the two and three parameter version. For very small values of m and n, my system will calculate and print results returning from A0 and A1 method calls. However anything…

ASLilly
- 39
- 3
2
votes
1 answer
How to convert a variation of ackermann function to support tail call?
I'm currently solving a problem which is to implement a variation of ackermann function in scala with tail call optimization support so that the stack does not overflow.
The problem is, I cannot find a way to tail-call optimize it. I'm told…

PeaceSong
- 38
- 6
2
votes
1 answer
How to write Ackermann Function iteratively?
I wrote a recursive version of Ackermann Function, and it worked properly:
int ackermann_r(int m, int n) {
if(m == 0) {
return n + 1;
} else if(n == 0) {
return ackermann_r(m - 1, 1);
} else {
return ackermann_r(m…

bongbong
- 73
- 7
2
votes
1 answer
Avoiding Stack overflow with Ackermann function in R
I recently saw an interesting Computerphile Video about the Ackermann function and tried to recreate it in R, here's what I came up with:
Ackermann <- function(m,n){
if (m == 0){
return(n+1)
} else if (m > 0 & n == 0){
…

Ju Ko
- 466
- 7
- 22
2
votes
1 answer
Ackermann function in raptor
How does one create ackermann function using Raptor flowchart? Can it be done? I have a general idea, but i have no idea how to write function 2 or 3 a(m-1,1) or a(m-1, a(m,n-1).

thelion209
- 21
- 2
2
votes
1 answer
Who to talk to about non recursive Ackermann function?
I have written a non recursive solution to the Ackermann function, it seems to work perfectly and work faster than the common recursive solution. So I am confused as to why it is a non primitive recursive function if it can be solved iteratively?…
2
votes
2 answers
Find number of times Ackerman function is called in Python
I want to make a function that returns two values. The first should be the output of the ackerman function, and the second should be the number of times the function is called.
I've made the Ack function:
def ack(m,n):
if m == 0:
return…

Zahand
- 490
- 3
- 12
- 23
1
vote
1 answer
How can I optimize Ackermann Function?
I am required to find an optimization for the Ackermann function and explain the problem with the Ackermann problem itself. However, I'm not really sure where I should start. I understand that Ackermann's function grows faster than any primitive…

April Crude
- 117
- 7
1
vote
2 answers
Recursive Ackermann-Peter Function in x86 Assembly (NASM)
im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined as follows:
*a(0;m) = m + 1
*a(n + 1; 0) = a(n; 1)
*a(n + 1;m + 1)) = a(n; a(n + 1;m))
My Problem is i can't even imagine how to start…

WeGi
- 1,908
- 1
- 21
- 33
1
vote
1 answer
I wrote the "Ackerman" function in Visual Studio. Stack Overflow occured very quickly
I was watching this video - https://youtu.be/i7sm9dzFtEI on youtube, and decided it would be fun to copy that function in C#
Well I ran it, and it stopped after 21 calls and around one second. The guy's program on the video has apparently been…

MrVimes
- 3,212
- 10
- 39
- 57
1
vote
1 answer
How to call a function with multiple arguments using the Y combinator in ocaml?
I'm trying to understand the Y combinator in OCaml. I took some code from here, and I'm trying to use it to write the Ackermann function. In the examples in the link, the functions only require one argument. The Ackermann function requires two…

user3047641
- 149
- 1
- 2
- 12
1
vote
2 answers
Keep Getting Error For Ackermans Function
import java.util.Scanner;
//create AckermannsFunction class
public class Ackermann
{
public static void main(String[] args) {
//instance variables
String input; //holds user input for the numbers
int num1; //holds first…

13lank_null
- 29
- 4
1
vote
1 answer
How do I produce an error when input is bad?
I am trying to have my program output an error code when the input values are too high, but I can only get it to display the error message in the terminal window, not in the method return. Here is the code:
public class AckermannAdvanced {
…

Calico
- 149
- 1
- 1
- 5