Friday, November 21, 2014

Week 11 - Halting Program and Counting Set

This week is a short week because we had a 2 day break on Monday and Tuesday, which implies no class on these days. I felt that the long weekend seems exciting at first but soon after I noticed that the long rest isn't helping my present self. I basically spend the long weekend taking a long break, playing games and go out with friends, it is fun at that instant but for a long run I basically spend a lot of time not doing what I should have done, which is studying for exams and doing assignments.

Back to the topic, on this week's short lecture we were introduced with a few new concepts and the first one is whether a program will halt or not. Halting for a program basically means that if the program will stop doing its computing business and returns the control to the person who is giving the command. It is important to distinguish the difference between a very hard program which takes a long time to run, and a program were its not halting and goes on an infant loop.

It is also very important to know that it is impossible to construct a program that can show whether a program will halt or not because when we tries to write any function that has the magical power of showing the function will halt or not on an input (example like H(f,i) in the picture below) we can basically write down a function called navel_gaze, and by proving that navel_gaze is not commutable  because its contradiction to itself so it implies that the function used in navel
_gaze is also not commutable, proving its impossible to generate a function that knows whether the function will halt or not.

course note chapter 5, pg 8
We also learn in this week's lecture what is the definition of counting. We can count in many ways, referring one-to-one or one-to-many, we can even skip an item while counting. This is why when we say a set is countable we means its counted one-to-one and onto, so that one unique item only refers to another unique item in the set, and there is no item skipped while counting.

Countable sets include anything that is a subset of Natural numbers, Rational numbers is also countable due to it uses Natural numbers as its base (n/m , where n and m is natural numbers) so that we can always refer one Rational number to a Natural number without skipping, thus making it countable. Real numbers not countable because there is infinite amount of numbers you can find in it, and by giving out any of the numbers in between you can prove it not countable by a counter example.

The most important idea we learned in the lecture is where computer programs can only written to be work with sets that are countable lAl<=lNl , and anything that is not countable would be a mismatch in size.

No comments:

Post a Comment