Saturday, 29 November 2014

The Halting Problem

This week I am going to be talking about the halting problem, its definitely an interesting problem.  For anyone struggling with what it is trying to say, they should try using youtube.  I have found it a great resource for all of my courses really.  Computerphile and Numberphile are great channels to subscribe to.  They are filled with loads of interesting information.  For example Numberphile does a great infinite prime proofs.  They essentially do the proof by contradiction by saying that if there were a finite amount of primes they could be expressed in a list.  However if you took all the elements in that list, multiplied them together and added 1 you would get another prime, that isn't included in the list.  Hence there must be an infinite amount of primes.

The most amazing thing about the halting problem was that is was discovered before modern computers even existed.  Alan Turing was an absolutely brilliant mathematician and it is such a shame what happened to him.  He truly is the father of theoretical computer science.  I guess the halting problem also indirectly proves that through careful analysis results can be concluded even if there is no physical capability to test them.  Theoretical physicists everywhere should rejoice.  I heard my TA in my lab Monday tell an interesting story about how in the 1950's a software company noticed it was spending a lot of time debugging code and was trying to determine whether there was a program that could automatically debug code for them.  It turns out this is essentially the same as the halting problem and cannot be done.

In my simplest explanation of the halting problem I can say this:

To begin with assume that halt works.

Have 1 function composed of 3 functions.  One arbitrary function at the top, the halt function, and then a negation function that if halt returns true will get stuck and if halt returns false will return true.  Now try and feed the function into itself.

Case 1
So if the arbitrary function doesn't halt, halt will return false and the negation will return true.
Case 2
If the arbitrary function does halt, halt will return true, but then the negation function will get stuck in an infinite loop.

Therefore halting implies the function doesn't halt, and not halting implies the function does halt, which is a contradiction.

I am trying to explain what can be found in this video:
https://www.youtube.com/watch?v=92WHN-pAFCs

There are still a few hazy details for me, but I think that is a good explanation.  Hopefully there are no typos.

1 comment:

  1. I think it's cool that we can determine what technologies are capable of before they exist. My older brother is also in CS and has talked before about quantum computers, which, even though they don't exist, can still be theorized about and we already know what problems could be solved by them if they did.

    That video explains the halting problem very well. Thanks for linking to it!

    ReplyDelete