Questions tagged [ackermann]

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.

55 questions
0
votes
2 answers

How can I count the recursive calls of a function in Python?

I was playing with the recursive Ackermanns function. For certain values my prompt whould not show every calculated output 'cause Python whould exceed its recursive limit so fast that whould freeze the prompt before the "easy" parts whould catch up…
Demis
  • 197
  • 2
  • 10
0
votes
0 answers

Java- Creating an Ackermann Value graph

I am asked by my teacher to edit this graph code. The graph is already made. what he wants me to do is to adjusted the code so it graphs rescursive ackermann values. so if put m = 3 and n = 2 it graphs it. How do i adjust my ackermann method? Any…
Mo_Hakim
  • 1
  • 2
0
votes
1 answer

Ackermans' Function Try Catch issue

I currently doing an Ackerman function problem and we have to code in a fail-safe for the user input. So if the user input that would normally make the program crash, it would instead just send a message. I was able to figure out the exception to if…
spotTop
  • 87
  • 2
  • 7
0
votes
1 answer

Object not applicable in MIT Scheme (a different Ackermann's function)

I found this version of Ackermann's function and tried to code it in MIT Scheme Lisp with no success: The Ackermann Function A(m,n) When m=0 A(m,n)=n+1 When m>0 and n=0 A(m,n)=A(m-1,1) When m>0 and n>0 A(m,n)=A(m-1,A(m,n-1)) (found here…
0
votes
1 answer

Ackermann Table Geneation

I'm working on learning more about Ackermann's function, recursion time, and functionology in general, however, my code won't compile. I have a feeling it's something to do with the arrays in acktgen(), but I'm not 100% certain. #include…
nick5435
  • 53
  • 8
0
votes
0 answers

Stack overflow when trying to compute Ackermann

As part of an experiment I wanted to see how long it would take to compute Ack(0,0) to Ack(4,19) both with and without caching/memoization. But I keep running into a simple stumbling block... My stack keeps overflowing. Here's my code: import…
Electric Coffee
  • 11,733
  • 9
  • 70
  • 131
0
votes
2 answers

Counting recursive function calls which are a multiple of k in C

The assignment was to create a program that computes the Ackermann equation using recursion, which I successfully did. Part of the assignment says: "The function should print the number of recursive function calls which are multiple of k. Set k =…
user1876409
  • 3
  • 1
  • 2
-1
votes
1 answer

Ackermann Termination: Root Cause Analysis

Probably not a lot of explanation needed as to what this is, and it even works exactly the way I want it to. My real problem is program termination. I've output traced my return values and the nested for loops I'm using in my main function to step…
-1
votes
1 answer

Why does this code print None?

The Ackermann's Function had been tried to implement through the following code def A(m, n): if m == 0: return n + 1 elif m > 0 and n == 1: A(m - 1, 1) elif m > 0 and n > 0: A(m - 1, A(m, n - 1)) print A(4, 5)
rigel
  • 485
  • 1
  • 6
  • 12
-2
votes
1 answer

How to run Ackermann's Fuction without error in C/C++?

So how to I run Ackermann's Function without running into Segmentation fault (core dumped) error because of my program tries to access/expand memory that it doesn't hace access to? Maybe expanding the memory limit of GCC to 256MB? It causes this…
Nabeel Parkar
  • 348
  • 3
  • 15
1 2 3
4