Machine language part seems the most fun part in this course!
It actually makes me interested a lot :P
Hey, non-CS people, we create languages!
Tuesday, December 4, 2012
Friday, November 30, 2012
A3 due today
A3 seemed easy at first, but it is ... hard.
It is due tonight, and I'm still working on it :(
The loop invariant thing is difficult to come up, and to prove.
It is due tonight, and I'm still working on it :(
The loop invariant thing is difficult to come up, and to prove.
Saturday, November 24, 2012
Machines, Automaton!
Wow, time really flies. It is already the last week of November!
I am getting familiar with automatons --- accepting / dead states and more.
I am getting familiar with automatons --- accepting / dead states and more.
Friday, November 16, 2012
Correctness
For about last 2 weeks, we have talked about correctness about functions.
The logic is very neat but it is a little bit hard to get used to figuring out necessary conditions.
I think it really requires a lot of practice :(
Studying hard about this topic!
The logic is very neat but it is a little bit hard to get used to figuring out necessary conditions.
I think it really requires a lot of practice :(
Studying hard about this topic!
Monday, October 29, 2012
Complexity of Recursive Functions
We talked about complexity of a recursive binary search.
Before the class, I went through the annotated slides for Thursday's class, but it seemed to be hard to understand.
The recBinSearch function looked complicated, and there were bunch of questionable c's.
Actually, I'm still trying to fully understand about last week's lecture.
Hopefully, by the end of this week, I'll get through this!
Before the class, I went through the annotated slides for Thursday's class, but it seemed to be hard to understand.
The recBinSearch function looked complicated, and there were bunch of questionable c's.
Actually, I'm still trying to fully understand about last week's lecture.
Hopefully, by the end of this week, I'll get through this!
Sunday, October 21, 2012
Mathematical Induction
Principle of (simple) induction: Let A be any set that satisfies the following properties:
(i) 0 is an element of A;
(ii) For any i∈A, if i is an element of A then i + 1 is also an element of A.
Then A is a superset of N.
(i) 0 is an element of A;
(ii) For any i∈A, if i is an element of A then i + 1 is also an element of A.
Then A is a superset of N.
Tuesday, October 16, 2012
Well-ordering
Principle of well-ordering: Any nonempty subset A of N contains a minimum element;
i.e., ∀A⊆N, A≠ø ⇒ ∃a∈A, ∀a'∈A, a ≤ a'
Let's prove: ∀n∈N, 1 + 2 + 3 + … + n = n(n + 1)/2
Define P(n) := 1 + 2 + 3 + … + n = n(n + 1)/2
Let S = {x: P(x) is not true}, then S⊆N
By the principle of well-ordering, there is a smallest natural number s∈S such that P(s) is not true.
Then s-1∈N is the greatest natural number such that P(s-1) is true.
Then 1 + 2 + 3 + … + (s-1) = (s-1)s/2
By adding s to both sides of the equation above, we get:
1 + 2 + 3 + … + (s-1) + s = (s-1)s/2 + s = s[(s-1)/2 + 1] = s[(s-1+2)/2] = s(s+1)/2
Then P(s) is true.
But this contradicts the assumption of s that s∈S such that P(s) is not true.
Therefore, no such element exists in S; i.e., S = ø
Hence ∀n∈N, P(n)
i.e., ∀A⊆N, A≠ø ⇒ ∃a∈A, ∀a'∈A, a ≤ a'
Let's prove: ∀n∈N, 1 + 2 + 3 + … + n = n(n + 1)/2
Define P(n) := 1 + 2 + 3 + … + n = n(n + 1)/2
Let S = {x: P(x) is not true}, then S⊆N
By the principle of well-ordering, there is a smallest natural number s∈S such that P(s) is not true.
Then s-1∈N is the greatest natural number such that P(s-1) is true.
Then 1 + 2 + 3 + … + (s-1) = (s-1)s/2
By adding s to both sides of the equation above, we get:
1 + 2 + 3 + … + (s-1) + s = (s-1)s/2 + s = s[(s-1)/2 + 1] = s[(s-1+2)/2] = s(s+1)/2
Then P(s) is true.
But this contradicts the assumption of s that s∈S such that P(s) is not true.
Therefore, no such element exists in S; i.e., S = ø
Hence ∀n∈N, P(n)
Wednesday, October 10, 2012
CSC236: Introduction to the Theory of Computation
§ in·tro·duc·tion
[in-truh-duhk-shuhn]
noun
1.
the act of explaining the basic facts about a subject.
1.
the act of explaining the basic facts about a subject.
§ the·o·ry
[thee-uh-ree, theer-ee]
noun, plural the·o·ries.
1.
a coherent group of tested general propositions, commonly regarded as correct, that can be used as principles of explanation and prediction for a class of phenomena: Einstein's theory of relativity. Synonyms: principle, law,doctrine.
2.
Mathematics . a body of principles, theorems, or the like,belonging to one subject: number theory.
a coherent group of tested general propositions, commonly regarded as correct, that can be used as principles of explanation and prediction for a class of phenomena: Einstein's theory of relativity. Synonyms: principle, law,doctrine.
2.
Mathematics . a body of principles, theorems, or the like,belonging to one subject: number theory.
§ csc236
[prerequisite: CSC148H1/CSC150H1, CSC165H1; CGPA 1.5/enrolment in a CSC subject POSt]
noun
1.
The application of logic and proof techniques to Computer Science.
1.
The application of logic and proof techniques to Computer Science.
────────────────────────────────────────────────────────
Unlike CSC165 that I took last year, CSC236 seems to be very tightly related to Mathematical perspective.
As I love Mathematics and its neat and clear logic, I've enjoyed the material handled in class a lot!
Subscribe to:
Posts (Atom)