Friday, September 26, 2014

CSC165 - Week Three - Conjunction, Disjunction, Negation, Truth Table and Law

The stuff in the title is exactly what we learned this week. We began by talking about conjunction, "AND", the symbol for conjunction is ^. it's a function to combine two statements and claim they are both true, conjunction can be seen as the intersection of the statements. Conjunction is only true when both statements are true. "think about the intersection"

(http://upload.wikimedia.org/wikipedia/commons/9/99/Venn0001.svg)

Next we talked about disjunction, which is close to conjunction except whenever one of the two statements is true, the disjunction is true. Disjunction can be seen as the union of the statements, and the symbol for disjunction is v. Disjunction is false only when both statements are false, it is true whenever one of the statements is true.

(http://upload.wikimedia.org/wikipedia/commons/3/30/Venn0111.svg)

Next up we talked about negation, negation is saying something opposite of a statement, it can be represented with NOT(statement), or ¬. Negation of the statement A is ¬A. An example of negation "All ferrari are red": we want to say something opposite of the statement "All ferrari are red", what is the opposite for the statement? "there are some ferrari that's not red" In venn diagram, negation can be represented as everything that's not the statement.

When we are depicting the truth value of only two statements, it can be easily done with a venn diagram, however, when we increase the number of variables, venn diagrams can be a real pain, it is too messy to see the truth value of a specific combination.
(http://www.newscientist.com/data/images/ns/cms/mg21528774.800/mg21528774.800-2_500.jpg)

It is beautiful, but it convey the truth value in an efficient fashion. Therefore, when we increase the number of statements or variables, we need a better way to show the truth value beside a venn diagram. This is when truth table comes into play.


In the truth table, the truth value of some function can be easily found. Truth tables seek to enumerate over the outputs of all possible combinations of inputs. In a truth table, the number of rows is directly exponential to the number of inputs. 
In the end we talked about laws and manipulations. They are like laws in math, but with boolean algebra, an example of the laws would be demorgan's law.

Friday, September 19, 2014

CSC165 - Week One and Two - First Impressions

So it begins!
This blog is meant to record my thoughts, learnings and questions during the wonderful fall semester of CSC165 of Larry,  the Mathematical Expression and Reasoning for Computer Science.

As a first year student, university is a wonder, every class feels so different, yet they are connected somehow. The feeling goes this way: in high school, physics is physics, math is math, Information technology is so different from them, let alone courses from another subject area. However, in university, it seems that everything is coming together, in a sense that my calculus, computer science, and philosophy lecture are all developing around logic and proof. It's an amazing feeling that everything is coming together and the courses can be each other's compliment. MAT.help(CSC).


Now let's get started with course material. IMO, the first week is an introduction week, the course material itself is not difficult by any means.

Week one
The course begins with the importance of communications and math in the field of computer science, then follows up with the precision of language, making us guilty of the ambiguous language everyday. The lecture finished with some python statements all() and quantifiers ∀ and ∃.

Week two begins by verifying and falsifying quantifier statements and venn diagrams. The employee's example made it all easier to understand. It is followed up with predicates P(x), difference between statements and sentences and implications P->Q. The implication part is particularly confusing, about which part of the statement is P(sufficient for Q), and which is Q(essential for P). We also talked about equivalence(iff) P<=>Q and contrapositive not Q=>not P.

e.g.
it is not beautiful if it is not round
The sentence means all non-round version of 'it' is not beautiful, thus not beautiful is a necessary condition for not round, therefore, not round is P, not beautiful is Q.