Saturday, 27 September 2014

Week 3: And/Or , Negations, Implications, and the Assignment

     Learning about conjunction and disjunction was more or less straight forward. The only trick was knowing that in english and even math, the words and/or can mean different things from what they would mean in logic in terms of and being a conjunction (intersection) and or being the disjunction (union). That is something I'll be keeping in mind when trying to translate logic statements between English and symbols. It isn't too difficult to think of and as being the intersection between two things and not the combination of those two things, but thinking of or as a disjunction is a little less intuitive. In English or tends to be exclusive, where it's one or the other, not one, the other, or both.

   Understanding Negations wasn't too tricky either. It makes a lot of sense that the negation of a "for all" statement would be a "there exists" statement and vice-versa. The trick we learned to push the negation sign in layer by layer was really helpful to figure out how to negate larger statements. As for scope, it was actually something that I had already been doing because it made sense to me before we went over it in class, but it was helpful to get an idea of the conventions and to learn about what different placement of parentheses can imply.

   We learned about how to use truth tables as well. I understand the value of using truth tables when a problem involves many predicates, but it is something I'm going to have to spend some time on because venn diagrams make a lot more sense to me visually.

Finally, the assignment info was released and I got started on it with my partner and more or less finished it. There are still some things I really want to go over. Particularly the last section with implications because some of the examples are a little tricky. I wont be going over them specifically to avoid sharing answers but it is something I want to look into and practice more. 

Wednesday, 24 September 2014

Week 2 : Quantifiers, Sentences, Symbols, Implications


        This past week began with to topic of quantifiers. Quantifiers are something that I'm familiar with from before taking this course, so they weren't particularly challenging to grasp and get a hang of the symbols involved in them. What was helpful, as I mentioned in the previous post, was the use of venn diagrams to determine how to make it false and how to make it true. I think it's a very useful approach to see how something can be verified and how something can be falsified, and not just one or the other, and the venn diagrams make that much more visual than written English or symbols. I've learned set notation in the past and only some of the symbols were new to me, but I still feel the need to always translate the symbols to english or a diagram to make sense of it. I'm not sure if that's a good thing or very inefficient, but I feel like I should work on being more fluent with these symbols, especially when it comes time to actually translate complex statements to them (simpler statements are fine).

     Moving on from quantifiers, there was the topic of statements vs sentences, predicates, and then implications. The difference between a sentence and statement was pretty straight forward at least by definition, although I had always thought they were synonymous (but that's in english, I just didn't know what they meant in logic). This lead into predicate and how they can be turned into a statement by quantifying them (L(x) -> L(something)). As for implications, most of it was straightforward, but but whatever reason the notion of a contra-positive went over my head during lecture so I had to look it up. Turned out that I was confusing it with an inversion, which does not depend on the truth value, but contrapositives do. The difference symbolically is like the combination of an inversion and converse. I just went through a few statements (in english) on my own to write out the converse, inverse, negation, and contrapositive just to make sure I have a solid idea of how they are different (and how they are related) . So something like this:

statement: All penguins are birds
converse: All birds are penguins (this is false and the statement is still true)
inversion: If it is not a penguin, then it is not a bird (also false, and the statement is still true)
negation: There exists a penguin that is not a bird (if this is true, then the statement is false and vise-versa)
contrapositive: If it isn't a bird, then it isn't a penguin (relies on the statement also being true)

I at least hope the above logic is correct.

Moving on, vacuous truth was discussed, and the idea of equivalence where a statement that is an empty set can be equivalent to another statement that is an empty set . . . . I think.
It wasn't really tough to grasp the concept, even it doesn't seem very intuitive (my initial thought on a vacuous truth would be to say it is false), but I can see how there is a distinction. The one thing I'm curious about is where this idea becomes useful/necessary because right now I can only think of weird examples of irrelevant stuff like an empty set of minotaurs who also tap dance.

Saturday, 13 September 2014

Week One: Problem Solving

The class began with some introduction and administrative information as expected. The topic then moved on to the subject of communication. Essentially it was about how statements made by humans taken out of context tend to be pretty ambiguous, while computers need language to be very strained and unambiguous (programming language). I felt that this material was pretty lighthearted, which I think is a good start for a mathematics course that may seem daunting.

The topic then moved on to problem solving, with some examples relevant to python. We were also taught George Polya's approach to solving problems. What was most interesting to me about these principles was the fourth one, to review and extend. As students we've been conditioned to move along to the next problem once we get things right, never looking back. Even if we've been suggested to do otherwise, the nature of rigorous examinations doesn't really permit one to revel in the moment of a solved problem (or at least, I don't feel like you get the time to). That being said, there ought to be some value in reviewing what you did (the rights and wrongs) at that very moment when you still understand it (and, you know, because you're also really happy). What Polya suggest is that if you go over what you solved, it can help you to extend those strategies to problems in the future. My goal is to use this strategy whenever I can to solve future problems.

As for the specific examples, the ones went over in class for now were pretty reasonable. I was able to figure out the q0 through q3 problems on my own, however, in class we went over them using venn diagrams, which I thought was a very helpful way to process the true and false statements. There was also the streetcar drama problem. When I first saw this problem I actually thought that there wasn't a complete solution to it. My initial reaction to all math problems has always been to look for the numbers and just work with that. I think this problem really pushed me to find information from the text, and especially things that don't seem like givens at all (eg. the sum didn't reveal the answer).

I actually went ahead and looked at the course notes and some of the logic puzzles in there. I tried out the first one on 3 boxes using the Polya strategy:

1) Understanding the Problem 
There are 3 boxes and 1 has the prize. You get to pick one of the boxes, and the host will a different box that doesn't have the prize. Now you get the choice between the box you already picked or the other unopened one. Which one would give you a better chance of winning?

So, what I know at this point is that upon first selecting from the boxes, I have a 1/3 chance of making the correct choice.

2) Devising a Plan 
I started out by considering each option, whether the first pick is better or to switch to the other box. I considered sticking with the first one picked, but my logic was that it wouldn't make a difference between the two (50/50), not that the first was actually better, but that doesn't answer the question. So there had to be more to this problem concerning probabilities.

3) Carrying out the plan 
I thought about how probabilities may make the two choices different. Eventually I realized that while on your first turn you have a 1/3 chance of choosing the right box, on the second turn that chance is increase to 2/3 now that one was revealed, so that must mean that the switch increases the likelihood of winning the prize. This was more of a guess at this point, but it seemed possible, yet counter-intuitive.


4) Review and Extend 
I spent some time trying to unravel if the 2/3 idea made any sense. Eventually, I'll admit, I just looked it up and found that this problem is identical to the Monty Hall problem. So, I guess the switch would be correct. In the future I'd probably try to solidify my logic before finding a source for it, but it did help me make more sense of it. At this point, I'm still trying to extend this knowledge to the next set of puzzles, so perhaps next week I'll go over how they went. 

Welcome to my SLOG!

Hello, and welcome to my CSC165 Course Log!

Here I'll be writing about my experiences in CSC165 at UofT each week. I'll be writing about anything to do with the course, whether material was challenging or easy, revision or completely new, exciting or really tedious. . . . . Hopefully nothing will be too tedious.

More importantly though, this will be about how and what I'm doing to overcome challenges, learn from mistakes, get things right. I'm sure a lot of the time I'll be writing about things that I haven't really figured out yet, but I hope that by writing about it they might make a little more sense.