Thursday, September 25, 2014

CSC165 Conjunction, disjunction, negation, implication

Week #3
Topic: Conjunction, disjunction, negation, implication

I really enjoyed studying this week’s material. I consider that truth tables are a great tool to understand how statements and logical operators relate to each other. Moreover, well known arithmetic laws such as commutative, associative and distributive are used to manipulate these logical expressions; therefore, it was a little bit easier to understand the material.
Something that came to my attention this week, is that mathematics, especially MAT137 deeply relates to CSC165. Some concepts such as negation, vacuous truth and the use of implications are aspects covered in both courses. For this reason, I found it useful to apply concepts from one course into the other.

MAT137
Write the negation of x ≤ 2 and x>1.
Answer: x > 2 or x ≤ 1

CSC165
De Morgan’s Law: ¬ (P ˄ Q)  ó ¬P ˅ ¬Q

If we replace P by x ≤ 2 and Q by x>1, we will end up having the same expression.

The use of Venn diagrams to explain logical manipulation rules was also useful to understand how these rules really work. I was skeptical, especially about P ˅ (Q ˄ R)  ó (P ˅ Q) ˄ (P ˅ R); however, drawing Venn diagrams and treating the expressions as sets helped me to comprehend the material better.

This video was useful to learn  the basics about truth tables: 






Wednesday, September 17, 2014

CSC 165_Week #1_Intoduction, precision, quantifiers

Week #1

Topic: Introduction, precision, quantifiers

I had some problems understanding the four cases dealing with sets. I am new to programming in python, so at the beginning it was hard to comprehend how the code was working. I overcame the problem by using the Python Visualizer. I went over the code step by step, and I realized that Python was taking one by one each element of the set1 and comparing these elements to the elements in the set 2. Once I understood the code, it was easier to figure out the description of the functions q0, q1, q2 and q3.

1)  Understanding the problem
What is given? A code in Python. Specifically: return all ({x in s2 for x in s1}), return any({x in s2 for x in s1}), return not any({x in s2 for x in s1}), return not all({x in s2 for x in s1})

2)  Devising a plan
Is there something similar?
A similar example was given in class before introducing this problem. The relationship between mathematical sets and the way we write them in Python, as well as the meaning of all and any were explained.

Possible approaches:
1)    Try different sets such as A={1,3}, B={1,3}, C={1,5}, D={12,15}
2)    Use the Python Visualizer
3)    See which sets could prove to be true for each function. Then, create them. And finally, see the Patterns that these new sets may have.

3)  Carrying out the plan
I carried out plan 1 first. I somehow understood the logic of the problem, but I didn’t feel confident enough. Hence, I carried out plan 2, which proved to be very useful. At the end, I tried plan three as a way to reaffirm the knowledge.

4)  Looking back
After I understood the logic behind the problem, I went over the problem again to look for patterns that could help me to solve similar problems.