The Most Difficult Program to Compute? - Computerphile

Visualizações 1 016 372
98% 16 205 189

The story of recursion continues as Professor Brailsford explains one of the most difficult programs to compute: Ackermann's function.
Professor Brailsford's programs:
Follow Up Film from the Prof in response to this film:
What on Earth is Recursion?:
Fibonacci Programming:
Heartbleed, Running the Code:
Please note, Ackermann is spelled incorrectly with one "n" on the title plate - Apologies
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham:
Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at:

Publicado em


1 Jul 2014



Baixar vídeos:

Carregando o link.....

Adicionar a:

Minha playlist
Assista mais tarde
Comentários 1 848
Pokemoneuro 6 dias atrás
I want this type of function done on a quantum computer,
John von Horn
John von Horn 10 dias atrás
Could we turbo Ackermann by using a lookup table of previously computed results?
John von Horn
John von Horn 10 dias atrás
Bet von Neumann could calculate Ackermann(100,100) in his head
This Is a name
This Is a name 18 dias atrás
So what would happen if you did this on a quantum computer?
CR Anish Chelliah
CR Anish Chelliah 25 dias atrás
Techically speaking all recursion is carried out by implementing a recursion stack hence you could use a for loop to implement any kind of recursion. Hence Ackermann's function too could be return using only for looops.
Pratik Maitra
Pratik Maitra 20 dias atrás
If my understanding is correct he is not talking about a for loop in the general sense but rather the inability to get a random ackerman number given a set of previously solved ackerman numbers in a reasonable timeframe as we do not know how long to run the for loop. In other words we cannot get a n upper bound for ackerman numbers. For eg we can get fibonacci number to get the 1000th fibonacci we can use a for loop that runs for 1000 iterations but otoh for ackerman numbers we are unsure what iterations ack(1000,2) will take.
jeffreyfuhz 27 dias atrás
i'm struggling to understand the program texts he printed out.
D Scheme
D Scheme 28 dias atrás
Zac Meyers
Zac Meyers Mês atrás
I'd be interested in you view of divide by 0 and the phenom that follows
TheRubyMoon Mês atrás
Welcome to the Million View Club!
can you use decimal answers in ackermans function to reduce the calculation and get an estimate of what it would normally be or does that actually make it harder or could you at least add a zero to the code so it subtracts 10 instead of 1 and write the code normally but I guess that wouldnt reduce the complexity of the code.
Ram Prasath
Ram Prasath Mês atrás
If a *quantum computer* comes in future will it be able to solve? (At least in a few thousand years 🤔 Who knows!!)
bandie9101 Mês atrás
many top processes are running as root...
REX [Entertainment]
2019: Now with my ROG laptop I can get ackerman (4, 1) in about 5 seconds. It's amazing how computing power escalates through time.
Proxy Mês atrás
I cannot get above (4,0) my program just crashes :c
I am Moot
I am Moot Mês atrás
We need to pour all cpu resources on this world to calculate the next number
P0is0ndagger127 Mês atrás
Wouldn't quantum computing solve this in a few months?
GamingButNotReally Mês atrás
I think this would be sped up a lot with dynamic programming
SurrealJC Games
SurrealJC Games Mês atrás
*finishes video* ... So what is recursion?
ewook Mês atrás
Had some fun, just to see what improvements can be seen over time ; On a lenovo laptop with a Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (boost to around 3,1Ghz) ackerman (3,14) is: 131069 Segmentation fault (core dumped) real 2m14,516s user 2m13,933s sys 0m0,092s On a slightly older workstation with a Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz (boost to around 3,1Ghz) ackerman (3,14) is: 131069 Segmentation fault (core dumped) real 4m14,349s user 4m12,767s sys 0m0,016s
Gerald Kenneth
Gerald Kenneth Mês atrás
I wonder how long it would take a memristor-based computer which no separation between processing and memory to compute the one after 4.1
Nick Martin
Nick Martin Mês atrás
Nvidia rtx 2080 ti
0MoTheG 2 meses atrás
What worries me is how much memory it will use.
Jase Rogers
Jase Rogers 2 meses atrás
Just looked up tetration. It's basically a ketamine trip.
GaryChap 2 meses atrás
Why are so many of those ackerman results a power of two, minus three? It holds continuously from (2,5) to (4,1) ... and with that stunning 65,533 on the end :O
alex jervis
alex jervis 2 meses atrás
I was glad that I was the Thursday Milk Monitor. Thursday was Maths Test Morning!
miguel verde
miguel verde 3 meses atrás
Beautiful Masterpiece
VladVladislav 3 meses atrás
Hey, don't stop that program. Eventually, at the end of times, when the Universe will get sufficiently cold, you could use that for insane computing powers
Black Lighting
Black Lighting 3 meses atrás
7:04 are you drawing attention to the shirt buttons...
Daniel Okey-Okoro
Daniel Okey-Okoro 3 meses atrás
super exponential
sergio loza
sergio loza 3 meses atrás
This man is my hero
Влад Хименко
the answer is 42
FISHD0G747 3 meses atrás
I'm intrigued by his estimation at around 11:50 that the number of seconds since the Big Bang being "at most" 2^500 ..... I did the math and it's actually around 2^58 or maybe 2^59. Yes, it's an upper bound that he's giving, but that is an astonishing margin to be off by, especially for someone generally so vastly intelligent It's roughly equivalent to me saying, in terms of orders of magnitude, that the number of socks I am currently wearing is "at most" 2^400
Dan Bhakta
Dan Bhakta 3 meses atrás
14:04 The Big Crunch. Does he know something?
Mike Anderson
Mike Anderson 3 meses atrás
What up from the year 2^65533.
Gloweye 3 meses atrás
Could you work it out if you cache your answers ? Well, I worked in less than a second until 4,1... that one just gave recursionerror. Going on...
threeMetreJim 3 meses atrás
Most of the time, if programming, recursion is best avoided. If someone feeds in values that cause an accidental (unforeseen) recursion, you'll end up with a crash and a debugging nightmare. Small embedded systems with limited stack space will be the worst offenders.
AlexanderMichelson 4 meses atrás
Hi, I implemented this function on JS, Java and C. On C I was able to compute acker(4,1) in under a minute, but after that I got segmentation error. My question is how is it possible to run this program for, say, 4 weeks. like in the video, without getting stack overflow error?
Louis Carliner
Louis Carliner 4 meses atrás
Isn’t bigger problem is that the number of stack frames during the process consumed all available memory?
Salman Hussain
Salman Hussain 4 meses atrás
Who knew a recursive function so innocent looking could be so twisted and manipulative...
Santhosh Jallu
Santhosh Jallu 4 meses atrás
There goes our nemesis runtime error
Giancarlo Andre Bravo Abanto
6:24 no no no no my head again! exploded... err no. 242 not able to think restart or sleep now
Ziad 4 meses atrás
I tried calculating it on my machine, it took 6 seconds for ack(4,1), then left it for a minute just to return "Segmentation fault (core dumped)" pretty disappointing.
Mi 28
Mi 28 5 meses atrás
Tried running Ackermann function on Ryzen 7, the program crapped out with stack overflow instantly.
Fine Dandy
Fine Dandy 5 meses atrás
But can it run recursive crisis?
hpms 5 meses atrás
You mean hackermann function ?
smanzoli 5 meses atrás
I´m running it in my Quantum Computer emulator! Just waiting for the answer to be spilled.... hmmm, need a coffe....
00UncommonSense00 5 meses atrás
I would like to see this program run on the new Oak Ridge National Laboratories supercomputer running at 200 petaflops. Just to see what that three minute time frame would be reduced to, and have a go at the ack 4,1. Perhaps it may be fast enough to deliver an answer before the Big Crunch...
Daniel Hoven
Daniel Hoven 5 meses atrás
my computer breaks at (4,0)
Smeq Wack
Smeq Wack 5 meses atrás
i did the code just like the one on the paper, it reached ack(4,1) around 37 seconds, but then afterwards it just crashed and dumped the core...
Dale Robertson
Dale Robertson 6 meses atrás
The only regret I have in my life is learning this late in my life, from Professor Brailsford's and rightly so, and so lucky I am. What an honor to stand on the shoulders of the masters of the computer coding & math sciences resident in my grandfather's home country. Thank you all at Computerphile. Cheers... Dale Robertson professional student. College of Marin
Hashirama Senju
Hashirama Senju 6 meses atrás
State of the art computer torture
DarkSwordsman 6 meses atrás
2^(65533 * 3), at least in my Ubuntu 18.04 calculator, gave me "Overflow: the result couldn’t be calculated". Lol
Saikiran 6 meses atrás
Recursion is recursive
Eric Green
Eric Green 6 meses atrás
Stop program (0muse)
Eric Green
Eric Green 6 meses atrás
La la la la la la la
Eric Green
Eric Green 6 meses atrás
Whatever floats u're boat
Eric Green
Eric Green 6 meses atrás
Nope I'm not going to do it I don't know the answer
Paktric 6 meses atrás
Drink every time you hear 'recursive'
mansoor saad
mansoor saad 6 meses atrás
Thanks , such a nice and clear explanation :)
00UncommonSense00 6 meses atrás
I would like to see this ran on one of the governments super computers. Not the old obsolete Cray machines, I am talking about the Summit system that took dethroned the Chinese on last year. This baby is capable of reaching 200 petaflops, right now it's running at 145 petaflops. How many more answers will it produce? Would it deliver one more answer?
Márcio Júnior
Márcio Júnior 6 meses atrás
New game: Drink everytime he says recursion
Próximos vídeos
Switching Lives With Jeffree Star
Visualizações 7 980 601
[M/V] SEVENTEEN(세븐틴) - 독 : Fear
Visualizações 10 558 208
Visualizações 25
Introducing How Computers Work
Computer Basics: Hardware
Visualizações 1
VOU SER PAI !!? ‹ JonVlogs ›
Visualizações 505 407