[tinspire] Recursive function

357 views
Skip to first unread message

Jim Fullerenex

unread,
Dec 23, 2011, 9:11:03 PM12/23/11
to Nspire Group
Hi everyone,

I need some help here on recursively-defined functions.

I'm trying to define the Ackermann–Péter function
  http://en.wikipedia.org/wiki/Ackermann_function#Table_of_values
According to the table of values, apf(3,4) should be 125. First of all, the result 125 is way below Nspire's numerical capability (it can handle up to 10^1000 !). Second, the recursion of apf(3,4) is not that much to blow up! But my CAS gives "Error: Resource exhaustion"

Also, when defining "hyperoperation"  http://en.wikipedia.org/wiki/Hyperoperation I get the same problem: resource exhaustion when there's actually so little to be done.

Can anyone help me out, or give me an explanation? Thanks!

Best,
Jim

12-24-2011 Image001.jpg
12-24-2011 Image002.jpg

John Hanna

unread,
Dec 24, 2011, 8:28:03 AM12/24/11
to tins...@googlegroups.com

 

My version below works OK. Perhaps your piecewise notation is getting in the way?

An interesting challenge for CS students is to display the evaluation process!

 

 

 

     John Hanna

     jeh...@optonline.net

     www.johnhanna.us

     T3 - Teachers Teaching with Technology

     "A cowchip is paradise to a fly."

 


--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

image001.gif

Jim Fullerenex

unread,
Dec 24, 2011, 9:21:14 AM12/24/11
to tins...@googlegroups.com
Thanks John. But I guess you're trying the recursion on the computer software, right?
I just tried. The function still blows up on hh, even if it's not defined in a piecewise manner. But the SS works fine.

It seems that ak(3,4) has 127 levels of recursion. So maybe Nspire is still not good at handling that much. ;)

Best,
Jim



2011/12/24 John Hanna <johne...@gmail.com>
image001.gif
Reply all
Reply to author
Forward
0 new messages