proof that Ackermannfunction is uniquely defined and finding algorithm without recursions to calculate its...
$begingroup$
my question is involving the Ackermannfunction.
Let's call a function $a: mathbb{N} times mathbb{N} rightarrow mathbb{N}$ "Ackermannfunktion", if for all $x,y in mathbb{N}$ the following conditions are fulfilled:
1) a(0,y) = y+1
2) a(x+1,0) = a(x,1)
3) a(x+1, y+1) = a(x, a(x+1, y))
Now I have to proof that there exists
a) at least one and
b) at most one
such function.
c) write a programme (or describe an algorithm) without recursive calls that for every input (x,y) calculates a(x,y).
d) Then calculate or describe a(4,2018).
I am not sure, what in a) is to do. Do you know what is meant?
For b) I tried with functions A and B, that fulfill all three requirements, to prove that it's (A-B)(x,y) = 0 for every input (x,y), but I didn't manage to do so (I only managed for the input (0,y)).
In c) I have no clue how to approach it.
d) I found on the internet how a(4,y) looks like, so I could write down the solution, but I don't know how you get to the expression of a(4,y).
I'd appreciate your help on this and am looking forward to your replies.
recursion computability recursive-algorithms ackermann-function
$endgroup$
add a comment |
$begingroup$
my question is involving the Ackermannfunction.
Let's call a function $a: mathbb{N} times mathbb{N} rightarrow mathbb{N}$ "Ackermannfunktion", if for all $x,y in mathbb{N}$ the following conditions are fulfilled:
1) a(0,y) = y+1
2) a(x+1,0) = a(x,1)
3) a(x+1, y+1) = a(x, a(x+1, y))
Now I have to proof that there exists
a) at least one and
b) at most one
such function.
c) write a programme (or describe an algorithm) without recursive calls that for every input (x,y) calculates a(x,y).
d) Then calculate or describe a(4,2018).
I am not sure, what in a) is to do. Do you know what is meant?
For b) I tried with functions A and B, that fulfill all three requirements, to prove that it's (A-B)(x,y) = 0 for every input (x,y), but I didn't manage to do so (I only managed for the input (0,y)).
In c) I have no clue how to approach it.
d) I found on the internet how a(4,y) looks like, so I could write down the solution, but I don't know how you get to the expression of a(4,y).
I'd appreciate your help on this and am looking forward to your replies.
recursion computability recursive-algorithms ackermann-function
$endgroup$
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11
add a comment |
$begingroup$
my question is involving the Ackermannfunction.
Let's call a function $a: mathbb{N} times mathbb{N} rightarrow mathbb{N}$ "Ackermannfunktion", if for all $x,y in mathbb{N}$ the following conditions are fulfilled:
1) a(0,y) = y+1
2) a(x+1,0) = a(x,1)
3) a(x+1, y+1) = a(x, a(x+1, y))
Now I have to proof that there exists
a) at least one and
b) at most one
such function.
c) write a programme (or describe an algorithm) without recursive calls that for every input (x,y) calculates a(x,y).
d) Then calculate or describe a(4,2018).
I am not sure, what in a) is to do. Do you know what is meant?
For b) I tried with functions A and B, that fulfill all three requirements, to prove that it's (A-B)(x,y) = 0 for every input (x,y), but I didn't manage to do so (I only managed for the input (0,y)).
In c) I have no clue how to approach it.
d) I found on the internet how a(4,y) looks like, so I could write down the solution, but I don't know how you get to the expression of a(4,y).
I'd appreciate your help on this and am looking forward to your replies.
recursion computability recursive-algorithms ackermann-function
$endgroup$
my question is involving the Ackermannfunction.
Let's call a function $a: mathbb{N} times mathbb{N} rightarrow mathbb{N}$ "Ackermannfunktion", if for all $x,y in mathbb{N}$ the following conditions are fulfilled:
1) a(0,y) = y+1
2) a(x+1,0) = a(x,1)
3) a(x+1, y+1) = a(x, a(x+1, y))
Now I have to proof that there exists
a) at least one and
b) at most one
such function.
c) write a programme (or describe an algorithm) without recursive calls that for every input (x,y) calculates a(x,y).
d) Then calculate or describe a(4,2018).
I am not sure, what in a) is to do. Do you know what is meant?
For b) I tried with functions A and B, that fulfill all three requirements, to prove that it's (A-B)(x,y) = 0 for every input (x,y), but I didn't manage to do so (I only managed for the input (0,y)).
In c) I have no clue how to approach it.
d) I found on the internet how a(4,y) looks like, so I could write down the solution, but I don't know how you get to the expression of a(4,y).
I'd appreciate your help on this and am looking forward to your replies.
recursion computability recursive-algorithms ackermann-function
recursion computability recursive-algorithms ackermann-function
asked Dec 16 '18 at 18:33
StudentuStudentu
1279
1279
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11
add a comment |
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Proving uniqueness is pretty straightforward via two layers of induction. To give you some pointers:
$a(0,y)$ is uniquely defined.
If $a(X,y)$ is uniquely defined for some fixed $X$ and all $y$, then:
$a(X+1,0)$ is uniquely defined.
If $a(X+1,Y)$ is uniquely defined, then $a(X+1,Y+1)$ is uniquely defined
$implies a(X+1,y)$ is uniquely defined for that $X$ and all $y$.
To avoid recursive calls, notice how this function expands according to your rules. Take $A(6,3)$ for example:
$$begin{align}A(6,3)&=A(5,A(6,2))\&=A(5,A(5,A(6,1)))\&=A(5,A(5,A(5,A(6,0))))\&=underbrace{A(5,A(5,A(5,A(5,}_{3+1}1))))end{align}$$
In general,
$$A(x+1,y)=underbrace{A(x,dots A(x,}_{y+1}1)dots)$$
which allows you to avoid a lot of recursion via loops. You can keep track of which $x$'s you have separately as well, to avoid ever calling the function again, and basically repeatedly expand based on the "most recent" $x$ value.
For example, if you wanted to calculate $A(6,3)$, you'd start by making $4$ copies of $5$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $2$ copies of $4$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $1$ copy of $4$ followed by $2$ copies of $3$ evaluated at $1$. etc. Visually:
$$begin{align}A(6,3)&=underbrace{A(5,A(5,A(5,A(5,}_41))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,A(4,}_21))))))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,}_1underbrace{A(3,A(3,}_21))))))))\&=dotsend{align}$$
$endgroup$
add a comment |
$begingroup$
If I recall correctly, the "closed form" of the Ackermann function I knew was
$$A(x,y)=2uparrow^{y-3}x+3$$ where the uparrow is Knuth's and the power is the number of uparrows. I am not sure calculating this is without recursive calls. It doesn't call the routine to compute any other value, but unpacking the uparrows is a big job. There are several different Ackermann functions out there, so your closed form may differ in detail. I was able to prove mine by induction.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3042964%2fproof-that-ackermannfunction-is-uniquely-defined-and-finding-algorithm-without-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Proving uniqueness is pretty straightforward via two layers of induction. To give you some pointers:
$a(0,y)$ is uniquely defined.
If $a(X,y)$ is uniquely defined for some fixed $X$ and all $y$, then:
$a(X+1,0)$ is uniquely defined.
If $a(X+1,Y)$ is uniquely defined, then $a(X+1,Y+1)$ is uniquely defined
$implies a(X+1,y)$ is uniquely defined for that $X$ and all $y$.
To avoid recursive calls, notice how this function expands according to your rules. Take $A(6,3)$ for example:
$$begin{align}A(6,3)&=A(5,A(6,2))\&=A(5,A(5,A(6,1)))\&=A(5,A(5,A(5,A(6,0))))\&=underbrace{A(5,A(5,A(5,A(5,}_{3+1}1))))end{align}$$
In general,
$$A(x+1,y)=underbrace{A(x,dots A(x,}_{y+1}1)dots)$$
which allows you to avoid a lot of recursion via loops. You can keep track of which $x$'s you have separately as well, to avoid ever calling the function again, and basically repeatedly expand based on the "most recent" $x$ value.
For example, if you wanted to calculate $A(6,3)$, you'd start by making $4$ copies of $5$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $2$ copies of $4$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $1$ copy of $4$ followed by $2$ copies of $3$ evaluated at $1$. etc. Visually:
$$begin{align}A(6,3)&=underbrace{A(5,A(5,A(5,A(5,}_41))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,A(4,}_21))))))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,}_1underbrace{A(3,A(3,}_21))))))))\&=dotsend{align}$$
$endgroup$
add a comment |
$begingroup$
Proving uniqueness is pretty straightforward via two layers of induction. To give you some pointers:
$a(0,y)$ is uniquely defined.
If $a(X,y)$ is uniquely defined for some fixed $X$ and all $y$, then:
$a(X+1,0)$ is uniquely defined.
If $a(X+1,Y)$ is uniquely defined, then $a(X+1,Y+1)$ is uniquely defined
$implies a(X+1,y)$ is uniquely defined for that $X$ and all $y$.
To avoid recursive calls, notice how this function expands according to your rules. Take $A(6,3)$ for example:
$$begin{align}A(6,3)&=A(5,A(6,2))\&=A(5,A(5,A(6,1)))\&=A(5,A(5,A(5,A(6,0))))\&=underbrace{A(5,A(5,A(5,A(5,}_{3+1}1))))end{align}$$
In general,
$$A(x+1,y)=underbrace{A(x,dots A(x,}_{y+1}1)dots)$$
which allows you to avoid a lot of recursion via loops. You can keep track of which $x$'s you have separately as well, to avoid ever calling the function again, and basically repeatedly expand based on the "most recent" $x$ value.
For example, if you wanted to calculate $A(6,3)$, you'd start by making $4$ copies of $5$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $2$ copies of $4$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $1$ copy of $4$ followed by $2$ copies of $3$ evaluated at $1$. etc. Visually:
$$begin{align}A(6,3)&=underbrace{A(5,A(5,A(5,A(5,}_41))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,A(4,}_21))))))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,}_1underbrace{A(3,A(3,}_21))))))))\&=dotsend{align}$$
$endgroup$
add a comment |
$begingroup$
Proving uniqueness is pretty straightforward via two layers of induction. To give you some pointers:
$a(0,y)$ is uniquely defined.
If $a(X,y)$ is uniquely defined for some fixed $X$ and all $y$, then:
$a(X+1,0)$ is uniquely defined.
If $a(X+1,Y)$ is uniquely defined, then $a(X+1,Y+1)$ is uniquely defined
$implies a(X+1,y)$ is uniquely defined for that $X$ and all $y$.
To avoid recursive calls, notice how this function expands according to your rules. Take $A(6,3)$ for example:
$$begin{align}A(6,3)&=A(5,A(6,2))\&=A(5,A(5,A(6,1)))\&=A(5,A(5,A(5,A(6,0))))\&=underbrace{A(5,A(5,A(5,A(5,}_{3+1}1))))end{align}$$
In general,
$$A(x+1,y)=underbrace{A(x,dots A(x,}_{y+1}1)dots)$$
which allows you to avoid a lot of recursion via loops. You can keep track of which $x$'s you have separately as well, to avoid ever calling the function again, and basically repeatedly expand based on the "most recent" $x$ value.
For example, if you wanted to calculate $A(6,3)$, you'd start by making $4$ copies of $5$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $2$ copies of $4$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $1$ copy of $4$ followed by $2$ copies of $3$ evaluated at $1$. etc. Visually:
$$begin{align}A(6,3)&=underbrace{A(5,A(5,A(5,A(5,}_41))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,A(4,}_21))))))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,}_1underbrace{A(3,A(3,}_21))))))))\&=dotsend{align}$$
$endgroup$
Proving uniqueness is pretty straightforward via two layers of induction. To give you some pointers:
$a(0,y)$ is uniquely defined.
If $a(X,y)$ is uniquely defined for some fixed $X$ and all $y$, then:
$a(X+1,0)$ is uniquely defined.
If $a(X+1,Y)$ is uniquely defined, then $a(X+1,Y+1)$ is uniquely defined
$implies a(X+1,y)$ is uniquely defined for that $X$ and all $y$.
To avoid recursive calls, notice how this function expands according to your rules. Take $A(6,3)$ for example:
$$begin{align}A(6,3)&=A(5,A(6,2))\&=A(5,A(5,A(6,1)))\&=A(5,A(5,A(5,A(6,0))))\&=underbrace{A(5,A(5,A(5,A(5,}_{3+1}1))))end{align}$$
In general,
$$A(x+1,y)=underbrace{A(x,dots A(x,}_{y+1}1)dots)$$
which allows you to avoid a lot of recursion via loops. You can keep track of which $x$'s you have separately as well, to avoid ever calling the function again, and basically repeatedly expand based on the "most recent" $x$ value.
For example, if you wanted to calculate $A(6,3)$, you'd start by making $4$ copies of $5$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $2$ copies of $4$ evaluated at $1$. Then you'd have $3$ copies of $5$ followed by $1$ copy of $4$ followed by $2$ copies of $3$ evaluated at $1$. etc. Visually:
$$begin{align}A(6,3)&=underbrace{A(5,A(5,A(5,A(5,}_41))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,A(4,}_21))))))))\&=underbrace{A(5,A(5,A(5,A(5,}_3underbrace{A(4,}_1underbrace{A(3,A(3,}_21))))))))\&=dotsend{align}$$
edited Jan 10 at 12:29
answered Jan 9 at 22:45
Simply Beautiful ArtSimply Beautiful Art
50.6k579183
50.6k579183
add a comment |
add a comment |
$begingroup$
If I recall correctly, the "closed form" of the Ackermann function I knew was
$$A(x,y)=2uparrow^{y-3}x+3$$ where the uparrow is Knuth's and the power is the number of uparrows. I am not sure calculating this is without recursive calls. It doesn't call the routine to compute any other value, but unpacking the uparrows is a big job. There are several different Ackermann functions out there, so your closed form may differ in detail. I was able to prove mine by induction.
$endgroup$
add a comment |
$begingroup$
If I recall correctly, the "closed form" of the Ackermann function I knew was
$$A(x,y)=2uparrow^{y-3}x+3$$ where the uparrow is Knuth's and the power is the number of uparrows. I am not sure calculating this is without recursive calls. It doesn't call the routine to compute any other value, but unpacking the uparrows is a big job. There are several different Ackermann functions out there, so your closed form may differ in detail. I was able to prove mine by induction.
$endgroup$
add a comment |
$begingroup$
If I recall correctly, the "closed form" of the Ackermann function I knew was
$$A(x,y)=2uparrow^{y-3}x+3$$ where the uparrow is Knuth's and the power is the number of uparrows. I am not sure calculating this is without recursive calls. It doesn't call the routine to compute any other value, but unpacking the uparrows is a big job. There are several different Ackermann functions out there, so your closed form may differ in detail. I was able to prove mine by induction.
$endgroup$
If I recall correctly, the "closed form" of the Ackermann function I knew was
$$A(x,y)=2uparrow^{y-3}x+3$$ where the uparrow is Knuth's and the power is the number of uparrows. I am not sure calculating this is without recursive calls. It doesn't call the routine to compute any other value, but unpacking the uparrows is a big job. There are several different Ackermann functions out there, so your closed form may differ in detail. I was able to prove mine by induction.
answered Jan 10 at 0:54
Ross MillikanRoss Millikan
298k23198371
298k23198371
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3042964%2fproof-that-ackermannfunction-is-uniquely-defined-and-finding-algorithm-without-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
By recurrence on the first parameter, you can show there is only one such function (You already did for x=0). To make a program without recursion, you'll need a stack and a while loop.
$endgroup$
– Xoff
Dec 17 '18 at 10:11