Sunday, November 30, 2014

sLog Week 12: Diagonals

               Every couple of weeks or so, Danny will give us a problem-solving exercise to complete (or not) in class. Almost every week I try the problems, work in circles for a while, and then eventually wait it out until we can look at a hint, or Danny presents a possible solution to this class. This week, however, I feel like I was finally able to make good progress in my solution without being guided through it. 'BUT HOW DID YOU DO IT?' I hear you ask. Worry not my friend, I'll walk you through my process of solving the problem.

The original problem

Understanding the Problem
                I took several approaches to trying to understand the problem presented to me: drawing diagrams, discussing the problem with my partners, and rewording the problem in my own words. This gave me a clear goal that I needed to reach, and allowed me a clear vision of what my solution was supposed to look like (for example, this question required some sort of equation or set of equations that represented a pattern of the number of squares the diagonal line passed through).

Devising a Plan
                This step can be very easy to overlook, but it's definitely important to plan out your work before doing anything. Randomly guessing and checking can be extremely time consuming, and was likely the reason I spent the last couple of problem-solving classes making circles around nothing. This problem felt like it was closer to home, as the analysis of the properties of shapes was familiar territory to me. Based on my past experience with analyzing properties of shapes, I started devising a general plan. 
                What I decided to do was to begin by drawing lines on the provided grid and recording the results in a chart. My method of recording data would be to change single variables at a time, and observing what happened when one dimension changed. Following this step I would either expand the grid and collect more data, or attempt to identify a pattern given the data (I was anticipating having to do the former). What actually happened when executing the plan was a different story...

Executing the Plan


               Things don't always exactly go as planned...and that's not necessarily always a bad thing. Upon creating the chart and attempting to analyze the limited data, I started noticing... pretty much no discernible pattern that applied across all values of m and n. At this point, I thought it was time to split up the problem into cases, as I started to consider the possibility that the number of squares depending on the property of the dimensions (i.e. odd numbers, even numbers, etc.). After further analysis and some amounts of experimentation, I came up with the following equations:

When n = m + 1 or m = n + 1 (or there is one even and one odd value), # of squares = n + m - 1
When n = m, # of squares = n or m
When n and m are even and not equal, # of squares = n + m - 2
When n and m are odd and not equal, # of squares = n + m - 1

This is my work and thought process for the solutions I came up with

Looking Back
               Looking back at my thought process and solutions, I'm actually quite proud and happy with my work. I do think that discussing my thoughts with other students would have allowed me to come to my solution quicker, and perhaps would have even made my solution and more efficient. I'd love to hear what other people did, and any alternate solutions people came up with. If anyone has any advice or tips they'd like to offer based on my solution, I'd love to hear them!

Sunday, November 23, 2014

sLog Week 11: Impossible, You Say?

     Adidas, you might want to re-brand your campaign because impossible definitely is NOT nothing. Halting theory pretty much blew my mind this week because yes, some problems just cannot be solved. It's kind of amazing to think about abstract ideas like infinity, and to be able to prove that computers can be defeated. I didn't take this seriously at first - there was no way I was going to be defeated by a couple of lines of code -, so I decided to try to solve it myself. After sacrificing several precious minutes of the lecture trying to find an accurate implementation of the provided problems given on the slide. After a while, I realized that (as Danny later clearly stated), we cannot give infinity a value. My calculus professor told us at the beginning of the semester that "infinity is a place", and I've been trying to wrap my head around that idea ever since. It's interesting to come across these concepts and I really enjoy the thought-provoking content this course provides. The delicacy and elegance with which Computer Science courses are taught is one of the many reasons I love the DCS at the U of T.

Sunday, November 16, 2014

sLog Week 10: Three Bounds In A Pod

     I've been reading other people's slogs a lot recently, as it's really interesting to see that other students in this course are struggling with/thinking the same things as me. Qasim's post this week really resonated with me, and I strongly agree with a lot of his ideas. I'm becoming more familiar with these bounded-proofs (more particularly big-O as I've had more practice with it recently), and I too am beginning to notice common patterns across similar proofs. I've also really benefited from tutorials in this respect, as I can confirm any assumptions and doubts I may have with certain aspects of the proofs. I enjoy having the opportunity to work on problems one-on-one with the TA's, as well as other students in my tutorial. I've mentioned this before, but I really do believe that tutorials are one of the most helpful aspects of this course. Especially with a course of this nature, it's important (for me at least) to talk through problems with others and ensure that one's problem solving instincts are directing them on the right course.

Sunday, November 9, 2014

sLog Week 9: Poly(NO)mials

     This week has been a roller-coaster of stress and emotions. We had our second term test this week, and it was all about the dreaded proofs I had mentioned (and cried about) earlier. I don't want to speak too soon, but I'm pretty sure that was not my finest hour. Ivan Zhang discussed the importance of having strong first year foundations in his slog posts here , and I couldn't have found it at a better time. I know that I can't just leave these concepts behind without solidifying my knowledge of proofs as it's going to come back to haunt me sooner or later (probably sooner than later, considering finals are coming up soon). I'm definitely going to have to practice some more proofs and make sure that I understand everything before completing this course. However, the 165 Train is chugging on with or without me, so I know I can't dwell on this sub-par test for too long.

     In class we discussed asymptotic analysis concerning polynomials and it's definitely been interesting seeing how big-O proofs can help us identify run-time efficiency. I can't help but visualize concepts with graphs, and Prof. Heap has some really useful visuals and ideas to help represent these new notions. I don't know if I'm used to big-O notation with polynomials just yet, but I'm glad that Prof. Heap has a welcoming way of introducing these new ideas.

Sunday, November 2, 2014

sLog Week 8: How Complex Is Your Complexity?

     This week we discussed the run-time of functions (more particularly sorting algorithms). I found it interesting to think of Python functions as as actual mathematical functions that have a certain fixed complexity depending on the 'calculations' happening within it. It was a fascinating way of combining basic algebra and applying it to proofs of the complexity of programs. I think it's important to be aware of the complexity of certain functions (including sorts) while writing programs, as it lets you know how efficient or inefficient your code actually is. Although it may seem like a few milliseconds here or there with every addition of a while-loop, I know that on large-scale tests of functions, each loop and if-statement will add up. I'm glad I'm being exposed to this logical way of thinking about programs and run-time this early on in my Computer Science studies, as I'm sure it will come in handy in my actual programming courses.

Sunday, October 26, 2014

sLog Week 6: C-C-Connections!

   It's been about a week since my last post, so you know that I've been having a hard time with proofs. However, as promised, I return bearing good(ish) news! I've been finding tutorials extremely helpful, and my TA Jason Harrison is great at explaining how to go about approaching them. I feel that with a little more practice I can master the art, and I'll eventually be able to do these things on my own. The tutorials have definitely helped my confidence, and a little more practice will hopefully help me be on my way.

   We discussed Epsilon-Delta proofs in class this week...yes, Epsilon-Delta proofs. I know what you're thinking: "Is this MAT137? Did you get Ivan Katchatourian's black bushy beard confused with Danny Heap's soft silvery-gray one?!" I heard prior to taking this course that it would be wise to take it alongside MAT137 and I definitely feel like I'm reaping the benefits. After roughly breezing over what Epsilons and Delta's represented in UC140, I looked around and saw several confused faces sitting in the dimly lit room. With some slight glances at my Calculus notes, I was able to make connections between "e-d" proofs and my knowledge of Epsilon-Delta proofs in the context of limits. Exploring "e-d" proofs solidified my understanding of the calculus material, and vice-versa. I can feel the logic-side of my brain being worked at by both courses simultaneously and I've gotta say, I don't mind at all.

Sunday, October 19, 2014

sLog Week 7: Impending Death

   I didn't previously mention my thoughts on taking the first CSC165 midterm, and that's mostly because I didn't wanna jinx it (yeah, I'm one of those people). I felt relatively confident about it, and I did enjoy doing the last venn-diagram question - but I'm not the best at test-taking and more often than not I'll be over-confident about a sub-par exam. As I signed into MarkUs, I thought about how much I genuinely enjoyed this course and how I shouldn't let my mark on this midterm define my perspective of this course (yeah I'm a cheese, I know). I think part of the reason I was so nervous about finding out my mark was because I really thought I understood the material well and I cared enough to want to do well. Am I building this up too much? Long story short, I was very happy with my mark. Weeks of struggling through python-function calls and understanding vacuous truth and venn-diagrams finally paid off!
   I'm feeling good this week, and I feel even more motivated to continue doing well in this course.