Monday 3 December 2012

conclusion


This is the last week of 236. Some classmates feel that this course is very easy. I don’t think so. This course is the most difficult one I have taken. Base on my programming experience, I feel some courses most students consider as tough, like 209, are not famous as their reputation. But I lack some theory fundamentals of computer. I had not learned any theory of computer before. I should learn some by myself. (Actually no theory skills need to be used during my work) That is the reason why I come back to school at this age. 236 is one of challenging courses for me, another one is mathematics. 

We are going to take final next week. Due to my poor term test 2, I had to go over the materials carefully for getting better mark.


About Blog


This is the first curse to require us write down a blog. I have not token higher level courses. Maybe there is another one asks us to do the same thing. I don’t know. Is that challenging? For me, No. I am keeping my personal blog since 2005. In my personal blog, I wrote articles for questions of interview, my opinion of programming, and some updated processing of the book I am translating. But, I have never thought about putting down my feeling about course. That should be a good idea to extend the topic of my blog. I will figure out a new category during the holiday break.

I do not write their blog by weekly. Sometimes I prepared the tests or quizzes, so I had to postpone updating my blog. But most time I could not remember to do this until some classmates asked “do you write your blog recently?” when we were chatting. So, everyone who always forgets to keep blog should set their clock alert to “wake up wake up, you have blog to write.”



Chapter 7: Regular Expression


The last part of this course is about regular expression. I have being used regular expression for a long time.  The material of lecture introduced is easy for sample. They include 0 and 1 only. (Oh, I am wrong, empty and null are included.)In practice, regular expression involves all characters and signs, like email address, http links or formatted numbers. So, the content we learned looks no useful. Maybe there is higher level course that expends this basic skill to introduce more complicated samples like we meet in the work.

So far, I do not know the usage of automata in the live. I remember I started to use regular expression at beginning of this century with some programming language(JAVA or C#??). Base on my opinion, regular expression and automata were developed with language development. So, we use regular expression to match search. Is it the unique application for regular expression?   

Friday 30 November 2012

Assignment 3


I am still wondering how to prove postcondition and termination.
In the question 4, I developed such program.
Function binSearch( x, A)
    b=0
    e = n – 1
    while ( b <= e )
    m = ( b + e ) // 2
    if (A[m] > x )
        e = m – 1
    else
        b = m + 1
return e
I tested it and got correct result base on professor’s example posted in piazza. But, I found it is very hard to prove loop invariant and postcondition. It is a little different of example of lecture. And professor did not show the entire proof.

If I modified code like this:
Function binSearch( x, A)
    b=0
e = n – 1
if ( x < A[0] )
    return -1
else if ( x >= A[n -1 ] )
    return n -1
else
        while ( b <= e )
        m = ( b + e ) // 2
        if (A[m] > x )
            e = m – 1
        else
            b = m + 1
    return e
This snippet seems to easier to prove one of postcondition that is -1<=p<=n-1. But, for my professional view, the former is more concise, the latter is more amateur.

Then, if I continued to make WHILE loop more bloated redundant, the proof would be easier and easier. As a professional developer, I could not accept such code like that. But….. how about my mark?
The solution has not been posted yet. I will check out professor’s answer. 

Thursday 29 November 2012

Chapter 2: Lemmas


When I did my assignment 3, I found some questions were about Chapter 2. I have not noticed this chapter. Professor held this chapter at eighth and ninth weeks. At that time, I thought those contents were come from chapter 3.

The chapter 2 talks about proving iterative and recursive codes. These codes in the textbook and lecture are very easy to understand. Actually, they are so easy that I don’t need to take any time to understand. But, the proof seems difficulty. When I proved questions of assignment, I wanted to quote Lemma 2.3, 2.4 and 2.6 for the same condition. I could use them directly. I had to use the method of proof of these Lemmas to prove the questions. Unlike the mathematics, these theorems and lemmas are shown in the textbook are samples only, they are not for quotation.

Am I wrong? 

Tuesday 20 November 2012

Chapter 7: DFSA


I got test2 back at last class. I got very low mark. That was the penalty for that I though this course WAS easy. I have only one last chance at final. I am planning to take some days off to go over carefully.

Last week, we saw DFSA. Drawing circle and arrow to show automata. Actually, I did not catch the meaning of that in the class. At weekend, I read the notes first, but still, it was not easy to understand. (Or it could not be understood easily at my age!!). So, I have to read another book “Introduction to Languages and the Theory of Computation (by John Martin)”. I found the samples are described more clearly. That is good for me. 

Quiz


The course will be done in this month. I felt the material is a little harder. At least, I could not catch some points during the lecture. Of course, that is my problem. I should go over the notes before the class. The content of quizzes in these weeks is followed the lecture tightly. So, if I have not understood what the professor introduced in the class, I could not figure out how to solve the question, even if TA explains some knowledge first. So, I lost full mark of quiz. This is a little bit unfair.