I found this concept so strange, the way we prove a function is not computable is by assuming it is computable and showing that it is a halting function and since a halting function is not computable then we can safely assume that our original function is not computable.
I find a lot of these concepts strange but I understand why the proof structure works. If something can't exist then you can't really say it does within your function.
After the assignment I was doing one of the tutorial problems, which was pretty similar to the assignment and it helped clear up some of the stuff that I was unsure of.
Here's how I did it.
Reduce halt to allstop.
all stop(P) = { True if P(x) halts for every input x,
{ False, otherwise'
def half(P, x):
def all stop(P):
#Check if P(x) halts
# for every input X
# Assume computable
def not_f(x)
P(x)
return "You shall halt"
return all stop(not_f, x)
The way I explained it to complete the proof was that if P(x) halted, that meant not_f(x) halts, which causes allstop(P) to return True. In the end this means that halt returns True as well. If P(x) doesn't halt, then not_f(x) doesn't halt which means allstop(P) would return False, which would cause the halting function to return False. So when P(x) halts, allstop returns True and halt(P, x) returns True and when P(X) doesn't halt, then allstop returns False and halt(P, x) returns False. So This means I have technically written a working halting function, which doesn't exist to my knowledge. So then we can safely assume that allstop is not computable since it is a halting function.
I hope that explanation makes sense, took a bit of explanation from my assignment partner for it to make sense of it when we were working on the assignment.
No comments:
Post a Comment