proof that Ackermannfunction is uniquely defined and finding algorithm without recursions to calculate its...












1












$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.










share|cite|improve this question









$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
















1












$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.










share|cite|improve this question









$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














1












1








1





$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.










share|cite|improve this question









$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






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










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


















  • $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










2 Answers
2






active

oldest

votes


















1












$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}$$






share|cite|improve this answer











$endgroup$





















    0












    $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.






    share|cite|improve this answer









    $endgroup$













      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      1












      $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}$$






      share|cite|improve this answer











      $endgroup$


















        1












        $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}$$






        share|cite|improve this answer











        $endgroup$
















          1












          1








          1





          $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}$$






          share|cite|improve this answer











          $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}$$







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Jan 10 at 12:29

























          answered Jan 9 at 22:45









          Simply Beautiful ArtSimply Beautiful Art

          50.6k579183




          50.6k579183























              0












              $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.






              share|cite|improve this answer









              $endgroup$


















                0












                $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.






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $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.






                  share|cite|improve this answer









                  $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.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jan 10 at 0:54









                  Ross MillikanRoss Millikan

                  298k23198371




                  298k23198371






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅