Friday, 26 September 2014

Week 2 - CSC165, seperating humans and computers since 1964

Man, how should I start off this slog post? With a sentence? Perhaps a statement. What's that? You don't know the difference between sentences or statements and that this is a horrible way to introduce what I've learned? Well let me enlighten you!

The main difference between sentences and statement is how they are quantified. For example:

Sentences are quantified existentially 
o   Eg. The employee earns less than $55,000, 
Statements are quantified universally
o   Eg. Every employee earns less than $55,000

Kinda different compared to English. Some things I've taken note of:
- A statement is always a sentence
- A sentence is not always a statement
- A statement can return true/false

Hmm.. this seems similar to the concept of Predicates! What's that? Am I going to use this exact same method to introduce more of what I've learned? Of course!

Predicates are kinda like giving properties to objects we declare. I'll demonstrate with the example showed in class. Assume L represents the employees who earn less than $55,000. 
If we want to say that employee "x" earns less than $55,000, we can write "x∈L,L(x)". 

We can turn this into a statement by universally quantifying it: 
eg. For each employee, the employee earns less than $55,000 
We can turn this into a sentence by existentially quantifying it:
eg. There exists and employee who earns less than $55,000

Now, you might say, Hmm... can't we also use sets to say the same thing? Which one should we use? I have no clue. Personally I find it difficult to see the difference between a property and set 

Now what does this imply? This implies that we should talk about implication. And yes, once again I forced the topic into this conversation. Anyways I consider implication like the if functions that we think of in computer science. 

if(P=true)
{
     Q=true
}

"if P, then Q". P is called the Antecedent (a.k.a. the assumption) and Q is the consequent (a.k.a. the conclusion). Generally can be summed up by "For P to be true, Q must be true." or "P implies Q", or "P requires Q" and probably many more ways to say this. 

Anyways, this is sometimes different than its English counterpart. For example, "If I do my homework, then I can play video games.". This sentence in symbolic language would make more sense if it was "If I don't do my homework, I cannot play video games". Similarly, implication doesn't imply causation, for example "If it rains yesterday, then the sun rises tomorrow". This is an implication, as you cannot falsify it. However, to falsify an implication, you must find an example where the antecedent is true, but the conclusion is false. If you cannot falsify it, then the implication is true! Also, you can make something imply in both directions! P<=>Q, basically means P=>Q and P<=Q, as simple as that. 

Now that I'm close to finishing this SLOG post, I just realized that I am very off-track from what I am supposed to write. More personal opinions and challenges, less course knowledge, got it. I'll keep this in mind for next SLOGS to come...

Now for the next post, be ready for more math symbols or/and maybe not? (<- thats the hint) 




Thursday, 18 September 2014

Week 1 - To be precise or not to be

Greetings friends. I am here to elaborate on my experiences with the CSC165 course. Problem is, I have no idea what I'm doing. What should I write about? How precise should I be?

Ironically, that was the topic of the 1st week's lesson with Prof. Larry Zhang.
Also ironically, we share the last name.

The 1st lesson introduced the concept of precision. Human languages (eg. English, Chinese, French, etc.) can be considered as both ambiguous and precise. It all depends on the wording of our sentences. To be precise with language, we must restrict the meaning of our words to prevent possible misunderstandings. However, being too precise means being too tedious and boring.

Computers require absolute precision in order to execute actions correctly, which is unfortunate for me because I suck at that. So how do we cope with these binary friends? Program comments of course! So for all those CSC148 students who don't write program comments, I don't know who you are, I don't know what you want, I will find you, and I will Liam Neeson you.

Now how will I solve this problem of non commenters? I probably shouldn't dive in without a plan. Thankfully my prof gave me some guidelines as to how to solve a problem.

1.       Understand the problem, find out what’s given and what’s required
2.       Plan solution(s), try more than one plan
3.       Carry out your plan, does it lead to the correct answer?
4.       Review your solution, convince others that your solution works

Step 1: Understand the non commenters, and why they don't comment
Step 2: Plan solution: Either Liam Neeson all the commenters, or try my best to remind them to make comments
Step 3: Tried Liam Neeson plan, got taken away by campus security, carried out the second plan, and got people to actually comment their programs
Step 4: Overview of solutions: Violence is not the answer. Comment your programs, save a life.

Result:
Result:
∃(p∈P)s.t. C(t)
There exists (existential quantifier) a person within the set of all persons, who comment their programs. If you want to disprove me, you're gonna have to prove that ALL people don't comment their programs. Good luck with that.

Goal:
∀(p∈P)s.t. C(t)
All people within the set of all persons comment their programs. This is going to be a tough one, because to prove it I have to get every single person to comment their programs, and all you need to disprove me is one example. 

Next time on Survivor: CSC165, stay tuned for sentences, symbols, and more math mumbojumbo.