Tuesday, December 2, 2014

Journal 10 - Week 11

Friday   November. 21st   Sunny

Hi everyone. Hope you guys have a good rest during the Fall break. As we all know, we did not have class on Monday due to our Fall break, which means there was not too many contents covered in this week. Also, our tutorial for this week was cancelled. Thus, let me just talk about the rest two lectures.

Firstly, algorithm and contradictory program are two important contents of Week 11. Although algorithm is no more a new topic, we still got something new. On the other hand, the definition of computable and non computable functions are introduced. We talked a little bit about reductions and how we can use reduction into our proof as well.

I found a good slog posted by my classmate which talks about countability. 
The link is:

He also summarized some methods for induction.

Secondly, I will talk about the hardest part this week and how I am trying to make it easier for myself. When we are proving a function to be uncomputable, we need another function (like halt as we did in class) to reduce them. We also need to write down some helper functions. This is hard for me to do at first. After I did a lot of exercises, I feel better now.

Thirdly, I chose one of the proof questions from assignment 3, which follows as below.
Q: Prove that the functions meaning_of_life below is not computable.

def meaning_of_life(f, I):
      “””
      Return True if f(I) returns 42, False otherwise.
      “””

Proof:
Assume that meaning_of_life is computable.   # for a contradiction
       def halt(f, i):
             def meaning_of_life(g, v):
                      """
                      Return True if g(v) returns 42, False otherwise.
                      """
             def f _prime(x):
                     f(i)
                     exec(“return” + 42)

             return meaning_of_life(f_prime, v)

       If f(i) halts, then f_prime(x) will execute the statement return 42, 
       so meaning_of_life(f_prime, v) returns True and halt(f, i) returns True.
       If f(i) does not halt, then f_prime(x) never executes return 42(no matter what                  value x has), so meaning_of_life(f_prime, v) returns False and halt(f, i) returns                  False.
Hence, there is no Python implementation of function meaning_of life.
Hence, the function meaning_of_life is not computable.

Lastly, again, our tutorial was cancelled, so I will not talk about the tutorial.

This is the end of the journal.

Much appreciated for reading my journal.

See you next week :)

No comments:

Post a Comment