Saturday, 29 November 2014

CSC165 week11SLOG:

     This week we had winter break, so I thought I will have not much to write about this course. But just like Forrest Gump said,"life is a box of chocolate." I never thought about that two totally new and confusing ideas,the halting problems and computability, were Brought into my life in this week's lecture. These two ideas are all about algorithm in the computer.

    In the beginning of the lecture, two great people Alonzo Church(who introduced Lambda calculus) and Alan Turing(who described Turing machine) were introduced. They showed that there are some problems that cannot be solved by algorithm,in another word, uncomputable.  An important idea to know is that the programming languages we run on the modern computers are "turing complete", that is to say, the computer can solve any problem a turing machine can. And a turing machine is not a real machine, it is just a system of rules, states and transitions conceived by Turing.  Lambda calculus is an example of turing completeness.

    Then professor gave some python codes and described how the codes works and how their running time are calculated(algorithm) in order to lead us to the halting problems. I learnt that I should use my head to think whether a code will hart or not rather than just run it, because a code may have a very long running time but it is not equal to endless(never halt).  For example, a code in the lecture:
def collatz(n):
    #n is a natural number
    while n>1:
        if n%2 == 0:
              n = n/2
        else:
              n= 3*n+1
    return "Reach 1.."
If we choose some very big and odd n,it may take a very long running time, and we can choose infinite number of natural numbers as inputs,so we have to finally come up with a proof to prove whether it will halt or not instead of running it forever.
       Next, some uncomputable functions were introduced to us. We can only say a function is non-computable when it is well-defined, and outputs for every inputs in some domain. but still cannot compute it. What's more, if we add some executable steps to a function to form another, then the original one is computable implies the new one is computable. For the contrapositive, if we reduce some executable steps to a function to form another, then the original one is non-computable implies the new one is non-computable.
       Finally, two terminologies ,one-to-one and onto,is taught in order to help us count finite sets. If a function (input A->B output) is One-to-one,1-1, then outputs of two inputs equal implies these two inputs equal, it prevents me from over-counting. A function(A->B) is Onto when for all outputs, there is an input, and it prevents undercounting.
     All in all, I now understand the computability and halting problems, but still lack of the ability to compute a function and prove the computability. I think we will be taught more detailedly about how to deal with these problems next week.

 
 








Reference:
http://en.wikipedia.org/wiki/Alonzo_Church
http://en.wikipedia.org/wiki/Lambda_calculus
http://en.wikipedia.org/wiki/Alan_Turing
http://simple.wikipedia.org/wiki/Turing_complete
http://simple.wikipedia.org/wiki/Turing_machine
 
   
 
 

 

No comments:

Post a Comment