Thursday 25 September 2014

The Week in Review: What is negation?

This week, we began learning more symbols and terminology.

On Monday's lecture, I was stuck on standard negation. It was Monday morning and I was feeling a bit tired. In class, I looked at the corresponding slide and tried to understand the concept, but to no effect whatsoever. My class was told to try and negate the following statement in two minutes:

¬(∀ x ∈ X, ∃ y ∈ Y, P(x) => Q(y))

I was out of it. I thought, I can't do this in two minutes! I need more than that! I copied the statement down in my notebook and tried to think about it. Eventually, time was up. This is the solution:

∃ x ∈ X, ∀ y ∈ Y, P(x) ∧ ¬ Q(y)

I wrote down the solution below the original statement, but I was still stuck. I talked to Professor Heap after class. As he explained, I realized I was overthinking. It was all review on negation. I then felt relieved, knowing that it wasn't as hard as I thought it would be. I regained my confidence.

Negating a statement means to take the opposite of the original statement. The negation (or opposite) of a universal claim (For all...) is an existential claim (There exists...) and vice versa. As well, the only time a statement is false is when the antecedent, P(x), is true, but the consequent, Q(y), is false. In this case, the original statement says that P(x) implies Q(y). However, to negate this, Q(y) has to be false while P(x) remains true in order to make the statement false because that's the only situation when this happens. (For all other cases, the statement is true.) Thus, we would have to put the "¬" symbol in front of Q(y). 

The next morning, I had my second tutorial. Our exercise involved writing English statements using logical symbols as well as determining true and false statements with explanations. The concept of math logic was still quite new to me, but I did make sure to ask my TA questions on things I found difficult. Once again, I hope I did well on my quiz, given that it was similar to the first question on the exercise. I did try my best.

I do find the idea of switching statements between math and English quite fascinating. It's something I have never seen before. Initially, I was lost when it came to this idea, but after getting proper help from Professor Heap and the TA over the weeks, I seem to be enjoying it now. 

Friday 19 September 2014

So it begins...

Hello and welcome to my CSC165 SLOG! This is where I post weekly updates on what's happening in class, including what I've learned so far and how the course is going.

Last week was the first week of classes, so all the topics on logic that I've learned are meant to introduce people to the course. I found out that this course does, indeed, involve considerable amounts of math, as the course is called, "Mathematical Expression and Reasoning for Computer Science." Computer science definitely needs math. However, I learned that this course is also about communication; in the computer science world, communication is done through creating programs and documentation, cooperating with others, and much analysis of programs and arguments.

Mathematical concepts were being introduced to the course day after day. On the second day of CSC165, I came across a familiar concept: building sets. I thought to myself, Hey! I learned this in MAT137! MAT137 is a full year calculus course. However, this was taken a step further and applied to the Python environment.

A set is given. For example, there exists the following set: S = {1, 2, 3, 4, 5, 6}. In Python, to check whether a statement is true, I would have to replace math symbols with with words, like so: {x for x in S if x > 2}. Python would then return the x values for which the statement is true; in this case, the values 3, 4, 5, and 6 would appear. The word "and" that is seen in math is replaced with "if." Similarly, "for" replaces the vertical line, and "in" replaces the element symbol. Using what I knew from MAT137, I was comfortable with the material.

This week, I had my very first tutorial at the Bahen Centre, and it was bright and early in the morning. My TA was taking up the exercise on universal and existential claims pertaining to sets that would prepare us for a quiz later on in the period. I understood the first question, but the second question involved Venn diagrams. I didn't understand it fully. I sat there with a confused look on my face. I felt frustrated, so I repeatedly said to myself, Don't give up. I couldn't grasp the material, but I knew that the best solution was to ask questions, not to be upset about it. I asked my TA to explain concepts that I found difficult. She explained everything thoroughly. She is a nice person. With that, I felt confident again. I smiled.

Once my TA passed the quiz around, I looked at it. There was only one question, but with two parts. I made sure to read carefully. I felt confident that I knew the answer to both parts as I reread everything to make sure I didn't miss anything. For the most part, though, I feel like I did pretty well. I left the Bahen Centre triumphant. My TA helped me deepen my understanding on the day's topic.

On Wednesday's lecture, I didn't quite understand some of the topics that were presented: implication and numerical examples of negation and contrapositives. I was lost. I didn't feel confident yet. I knew that Professor Heap held office hours every Wednesday afternoon, so I decided to go visit him in his office at the Bahen Centre after my 137 class to go over these concepts. He explained everything thoroughly. I found it very helpful, and I was able to have a clearer understanding of the concepts I found difficult. I felt better afterwards and thanked him.

I am very much looking forward to learning more concepts in this course.