Friday, 5 April 2013

Final thoughts...

I am writing this at 6 in the morning, not yet having slept because of all of the work that goes into finishing up projects at the end of the semester! Another semester has come to a close, but I felt as though I have learned so much these last few months. I have thoroughly enjoyed CSC165 (some friends of mine in CS told me that it was incredibly difficult and "not fun" -- I beg to differ! It is challenging, but rewarding). There is a steep learning curve in this course, and I can admit that sometimes I was not fully prepared for what was coming (cough cough, assignment 2), but once I spent a few quality hours going through solution after solution, I quickly began to understand that logic isn't so scary after all.

Met some really great people in my tutorial too, I hope to see them in future courses. To anyone who takes this course in the future, and who may stumble across my sLog: do not be afraid to take risks. Logic isn't "black and white", something you can easily memorize. It requires a lot of work, a lot of scribbled down notes, and a lot of trial and error until you can find "your" solution.

Overall, great course. I would definitely take it again! 

Time to problem solve

http://www.cdf.toronto.edu/~heap/165/W13/ProblemSolving/pennyPile.pdf

1. Understand the problem.

There isn't too many conditions with this problem, the problem itself is not too long.
What I know:

  • There are 2 drawers, let's call them L and R.
  • L = 64 (There are 64 pennies inside)
  • R = 0
Is it possible to arrange the drawers of pennies so that there is 48 pennies in one drawer considering the following conditions:
  • If the left drawer has an even number of pennies, I may transfer half of them to the right drawer.
  • If the right drawer has an even number of pennies, I may transfer half of them to the left drawer.
  • If L or R have an odd number of pennies, I am not allowed to do either operation.
2. Devise a plan.

In addition to the problem, Prof. Heap has included some nice "hints" to help begin the problem solving:
  • Work backwards.
  • Use smaller cases.
  • Draw a picture.
For me, I will work with the first hint, I am not sure which drawer will be the one containing the final number of 48 pennies, so it is best to consider both cases at the same time. We will call them Case 1 and Case 2.

Case 1: L has 48 pennies, R has 16 pennies.
Case 2: L has 16 pennies, R has 48 pennies.

3. Carry out the plan.

Case 1
Let's begin by working backwards:
L:48 -> L: 64
R:16 -> R: 0

Time to fill in what goes between "->"
L: 48 #I know that I am able to only move pennies when L/R are even.
R:16 #Both L/R are even, so let's move 16 pennies from L to R.

L: 32 #Interesting.. they are still both even, and they are now equal.
R: 32 #Let's move 32 from R to L.

L: 64 #We have completed the task this in 3 steps.
R: 0

Case 2
L: 16 -> L: 0
R: 48 -> R: 64

Time to fill in what goes between "->"
L: 16 #Let's move 16 from R to L.
R: 48

L: 32 #Let's move 32 from L to R.
R: 32

L: 0
R: 64 #We are done.

4. Look back, reconsider the problem. What were some things I have to overcome?

While this problem was not extremely complicated, it could become more difficult had one the numbers become odd, and I were restricted to moving only one drawer. For me, the most difficult part was thinking ahead. This is one of the tough things I encountered when learning proof structure. It can be difficult to think in terms of "one step ahead". Think of a Big-O or Big-Omega proof - you know what you start with, and what you want to end with, but you have to somehow think about how they will meet in the middle - thinking one step ahead.
One of the critical steps in this problem was knowing that if there is 48 in one drawer, there must be 16 in the other. From here, it was not too difficult to decide which way the pennies were meant to move. :)

Tuesday, 2 April 2013

A solution to the blue eyes problem

http://xkcd.com/solution.html

A (long, but precise) explanation of the solution to the "hardest logic puzzle in the world". A very interesting problem with an answer that may not sound complicated, but actually sounds like it would take a lot of time to wrap your head around! I know it took me a few times to read through the solution to fully understand. That is the fun part about logic, sometimes it makes too much sense! :)

Coming up on the end of the term, I want to make an update on some of the things I have been working on/feeling:

  • I really struggled on Assignment 2. I didn't fully understand how to complete a proof, I have only done proofs a few times outside of this class, but I found that those proofs were much more obvious/algebraic than the one's we are using in this class. I paid the cost with my grade for that assignment.
  • Somehow, I turned it around on the midterm. Well, not really somehow, but I remember going through practice problems from previous midterms. My boyfriend was helping me go through them and break them down and help me understand better. He is a computer science specialist in 3rd year, and has a lot more experience working with proofs than I did. He even wrote a few for me himself. 
  • I quickly realized that I had no idea what I was doing when it came to proofs, I was a nervous wreck, it was the night before the exam and I was terrified that I would do poorly (this was before I was aware of my a2 grade, so I was still under the impression that I had a grasp on what I was doing).
  • I spent more of the night doing problems over and over and over again, and then I quickly realized that there is almost a method to doing the proof, like the whole reason we write a proof structure in the first place -- I just could not visually understand it before I wrote my a2. 
  • If I had the chance to redo my a2 assignement, I am guessing I would improve drastically based on my new knowledge of proofs. I hope to prove myself on a3 and improve my grade before heading into the final exam.

Thanks for reading!