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.






Sunday, October 12, 2014

sLog Week 5: You Want Proof?! You Can't Handle The Proof!

Hi everyone, my name is Anam Alvi and I struggle with doing proofs.
I understand the structure of the proof, but what I find the most challenging about it is figuring out the actual process of coming to the result - that is to say, "the rough work". I guess it's just more difficult for me to see the connection between the initial statement and the final statement. I'm not too sure on how to approach this situation other than to just...practice. I'm sure that with practice I will be able to make connections more quickly and intuitively, as is with problem solving in general. But surely there's more I can do, right? After some discussions with classmates and reading some tips online, I've come up with a short checklist of things to help guide me through the rough work of my proofs.


  1. Do you have a clear understanding of what you are trying to prove?
  2. Have you clearly written out all the given information (hypothesis) and the final result (conclusion)? Do this symbolically or in full sentences. 
  3. Are there statements you can write that are 'widely known' (ie. 4 is a real number)? Don't waste time proving trivial things!
  4.  Have you seen any similar proofs to this one? Is there a particular strategy to approaching this kind of proof?


...and from there, just be creative and use what you know.

I hope that with some rigorous practice over the next week, I can report back with better results for my next post! If anyone has any suggestions as to how I can perfect proofs (whether that be tips for problem solving, writing comments, or a general strategy that has worked out well for you), feel free to leave a comment on this post. Any and all help is appreciated!

See you in 7 days!

Sunday, October 5, 2014

sLog Week 4: Obsessive Nature & Collaboration

     This week's main goal pertaining to this course was to successfully complete the first assignment due at the end of the week. At first glance, it didn't seem too time consuming...until I actually started doing it. Something I've started noticing about myself with this course is that I can't stand not completing a problem (or a set of problems). What ends up happening is that I'll work for as long as I can on the problem, but if I don't get the answer before I have to move on to another class or another assignment, I won't be able to get it out of my mind. In every second I can spare I'll find myself thinking about a different way to approach the problem or a possible solution. I have quite a lengthy commute to U of T that approaches 2 hours on most days, and more often than not I'll be working on any sort of 165 problem I can find or reading course notes. I'm worried it's becoming something of an obsession (if that's even possible with a course). Nonetheless, it helps me keep up with my notes and tutorials, so I'd rather be obsessed than lazy.

     The first assignment allowed us to work in groups of up to 3 students, which actually turned out to be my first group project in university so far. For the sake of minimizing our time together (we don't hate each other, I swear), we decided to do the entirety of the assignment individually and then come together and compare/discuss our answers. This proved to be a really good way of completing the assignment as we all got to understand the problem individually and then get feedback from each other on whether or not we were approaching it in the right way. We struggled the most with translating English to symbols with #1a, as well as drawing Venn Diagrams and differentiating between the different meanings of symbolic statements with #4b (who didn't struggle with #4?). With a lot of really intelligent discussion and brainstorming we eventually came to a consensus. I learned a lot from my group members about problem solving and communicating my thinking, and I hope they were able to take something away as well. Overall, we probably spent close to 4 hours working together, but it was definitely worth it and we all worked pretty well together.

Thanks for reading! See you next week.

Saturday, September 27, 2014

sLog Week 3: Is This True Love?

This past week of attending lectures and tutorials for CSC165 was great. Learning the concepts of disjunction and conjunction was a little challenging at first, but I found that collaborating with my peers and discussing ideas clarified a lot of confusion. I learned a lot during my tutorial as well, and I could freely ask as many questions as I wanted, not to mention that I actually enjoyed the exercises. My favorite part of this past week, however, was definitely the folding exercise we did in Friday's lecture. I really enjoyed the experience of investigating a problem and using an analytic process to try and reach a solution. I found the tips given on the back of the sheet fascinating, and I loved how creative and out-of-the-box thinking was used to arrive at a solution (ie. writing out the sequence in a certain way to visualize a physical pattern). I've looked forward to doing CSC165 course work this past week, and I hope this course continues to peak my interest in a similar fashion for the rest of the semester.

Thursday, September 18, 2014

sLog Week 1 + 2: Some Challenges

         What I found particularly interesting about this week's lectures was learning about logical implications and their restrictive meanings. I believe this is an extremely important concept to understand because it shows how careful one needs to be when working with logic problems (and in turn, with solving coding problems). It's easy to say "if you get a job in the field of computer science, then you'll be rich", but "if you're rich, then you must have a job in the field of computer science" is a false statement (counter example: Justin Bieber). Although this is a fairly simple sentence, it very accurately demonstrates the need for clear and meaningful statements. However, I quickly learned that it was significantly easier for me to understand these concepts when presented in easy English rather than symbols. I struggled quite a bit to keep up with the actual meaning of some of the expressions, as direct translations of the symbols seemed to make no sense. Realizing this, I knew I would have to spend much more time learning and reviewing the material than the time just spent in the lectures.

         My first step was to spend time daily reviewing Prof. Heap's annotated slides and making additional notes to the ones I had written, which was very helpful in reviewing and ensuring that I understood the class material. Additionally, I found that diagrams and other visual representations of the problems helped me solidify concepts and (quite literally) created a much clearer picture of the concepts for me. I also opted to go into Prof. Heap's office hours and seek further help. Prof. Heap not only clarified concepts but also made observations and gave me advice with my learning styles. He encouraged me to continue using diagrams and visuals to understand concepts, but to also focus on phrases and symbols to make sure I am clear on all levels. Finally, the class notes uploaded by Prof. Heap on CDF proved to be very detailed and helpful as well.

         Much of the material in CSC165 so far (universal/existential sets and quantifiers, logical implications, symbols using for denoting sets/phrases) has overlapped with material from MAT137 which I am also taking this term. Therefore, I'm glad I have a sufficient amount of resources and the learning skills to tackle the important concepts taught this week and last in CSC165.