The Most Difficult Program to Compute? - Computerphile
Video Statistics and Information
Channel: Computerphile
Views: 1,270,902
Rating: 4.956687 out of 5
Keywords: computers, computerphile, ackermann, algorithm, decidability, recursion, programming
Id: i7sm9dzFtEI
Channel Id: undefined
Length: 14min 55sec (895 seconds)
Published: Tue Jul 01 2014
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
That's a fun video.
A few comments:
Wow, K&R-style C. I haven't seen that in a good while. "Well-nigh on a quarter century, I'd reckon."
Hmmm, non-indented code. Unfortunately, I have seen that recently.
There will not be a "Big Crunch." Quite the opposite, in fact. They handed out a Nobel Prize a few years ago to the astronomers who showed just how massively "not a big crunch" the universe is.
(as a matter of fact: "You're tearing me apart, Lisa!" <-- mandatory reddit karma pandering quip.)
As others pointed out, the "recursion" can be done with for-loops and the appropriate data structures.
If he knows he'll be dealing with recursion of depth 265000 then he obviously needs to worry about overflow in his stack pointer, too, and not just in the result register.
I think (trying to remember what he said) he got his #particles in the observable universe and #seconds since the Big Bang wrong. it's about 4 x 1017 seconds since t=0. I.e., about 260 or so.
Despite my nitpicks, I love these Computerphile/Numberphile videos. Good enthusiasm. Good presentation. Excellent topics to spread to a popular audience. (Yes, I got very tired of explaining why -1/12 does not equal infinity a few months ago, but hey! it got people talking about Zeta functions, so it's a small price to pay!)
I just coded this up, and Ack(4, 1), which took the presenter's sytem 3 minutes to calculate, took less than six seconds on my 5-year-old Mac. Funny how computers progress. :)
C++11 code:
In 160 different programming languages on Rosetta Code
The video is inaccurate. Anything that can be implemented with recursion, can also be implemented with for loops and an explicitly maintained stack data structure for the function 'stack frames'. If you replace his statement with 'not computable with for-loops and a fixed amount of space' (e.g. so you can't use a growable stack data structure) then it makes more sense
Gah! Use a tripod, and stop fiddling with the camera!
Too bad he didn't mention memoization and its benefits, which are particularly evident with the Ackerman function.
Great vid, thanks.
You can speed up the calculation dramatically by making a large table for each Ackermann(column,row)
The only problem is that you need a very large table for larger values of M. The table gets as large as the value you get.
This is my result in a spreadsheet with 10000 rows.
Ackermann(N,M)
Calculation time: very fast < 0.5 seconds for 10000 rows. But one needs a lot of memory for much larger values.