Sunday, 5 April 2015

Week 12 - Final Impressions

This week, we had our final lecture, in which we talked briefly talked about the run time of algorithms, and big Oh. I found this material to be relatively easy, because we covered these topics more in depth in CSC165. However, I did have to review these concepts right after lecture, because I don't remember everything from CSC165. This just shows how important it is to keep reviewing and practicing material. We spent some time talking about the formal definition of Big Oh. I found that the professor was much more clear today than he was in other lectures, possibly because he enjoys mathematical concepts more, but nonetheless, it was another fantastic lecture. One reason why I enjoyed this lecture more than any other lecture is because the professor gave us many examples of code, and asked us to determine the growth rate of each function (relative to n). As in, is it log(n)? Linear? Quadratic? Usually, we don't get as many examples as we did in this lecture, so it is usually easy to dose off. This class kept us awake, because we were constantly working and involved in the lecture.

Thinking back at the course, I feel as though I have learned a lot and enjoyed this course a lot. Recursion is the most interesting and powerful thing I have learned in this course, and Assignment 2 added flavour to this course. It gave us the opportunity to apply recursive algorithms in a VERY interesting and productive way. There are somethings that I enjoyed less in the course, such as working with linked lists. I found that I personally enjoy concepts in which I see useful applications for, and the professors are very talented in coming up with examples in class that give interesting applications to concepts that are covered.

One of the most important things I have realized by taking this course is that practice is more essential than anything. Computer Science is not a spectator sport. It is not enough to know the theory of the concepts covered in the course. It is very important to be able to apply concepts learned and use them in solving lab problems and assignment problems. It is also important to practice consistently, because if we lose practice, it can be hard to start applying the same concepts again after a while. I have also learned that going to lectures is essential in any computer science course, because although the professor may post slides and sample code on his website, the explanations are golden in understanding what those slides mean and the purpose of the code written. Skipping lectures results in a loss of an opportunity to ask questions when we don't understand something.

My final impression of the course is very different to that of the blogger (http://saimaslog.blogspot.ca/). I don't feel as though I need an aid sheet to succeed on the final exam. In fact, I don't think that an aid sheet was even necessary on Test 1 an 2 because I never used one during the tests. I also felt as though I was reviewing course material while writing and aid sheet for the tests, not writing down things to help me during the test. Furthermore, unlike this blogger, I do not feel overwhelmed for the final exam, because I have been reviewing course material almost everyday, so I feel quite ready for the final exam.

I wish everyone the best of luck in their future endeavours as the course has ended, and I hope my friends to do well in the course.

Saturday, 28 March 2015

Week 11 - Revisiting an Earlier Blog Post

This week, I will be revisiting the blog post of Week 4. Back in week 4, we had just finished talking about classes and inheritance and we were simply introduced to the definition of recursion. At the time, inheritance was quite a new concept for me, and I also found the course material to be very easy. I thought that the course would be a breeze due to level of easiness of the material we were exposed to in the beginning of the course. I was also very excited because of the new friends I had made in the course that I found on Facebook while looking for partners for Assignment 1. I was very optimistic in Week 4, and I was also over confident, because I thought that the course material was too easy and I would get by without doing a lot of work like I did in CSC108. I WAS WRONG!

Looking back, I agree with my earlier blog post (week 4) when I said that I find the course material very interesting. At the time, I found inheritance to be an interesting concept, and I believed that the entire course would have many more interesting things to come. I was absolutely correct in that regard. In fact, recursion turned out to be very interesting and beautiful. Recursive algorithms have the power to take in a huge problem and break it down into tiny steps. As the course progressed, I had a lot of fun writing recursive code for labs and assignments. Additionally, I found Assignment 2 the most interesting part of the course. I had to write a strategy for a game that would always choose the best possible move, called Minimax. It used recursion to create a game tree, and choose a move that would lead the computer to always win the game. I was fascinated by the power of recursion, and the beauty of what we can do with just some simple coding! Therefore, I agree with my blog post of Week 4 when I say that the course material seems very interesting and fun.

However, I completely disagree with my blog post (of week 4) when I talk about how I feel the material of the course is very easy. As the course progressed, the material of the course got harder and harder. Although I found recursion to be a very interesting concept, I also found it to be very challenging. It was hard for me to understand how to trace recursion at first, but it was even harder for me to write recursive code. Whenever given a problem, I would jump write to writing code without understanding the problem fully, and drawing out trees to see what I would like to function to return at every step, like we were told to do so in class. I even struggled with traversing through linked lists when first introduced to the topic of linked lists. Therefore, I disagree with my comment on how I felt that the course is easy back in Week 4.

I agree with myself when I say that it is essential to go to lectures. Lectures in CSC148 provide the basic foundation and understanding of the course material. The professor goes through basic concepts and provides examples related to the topic, which helps us get started on the labs. Additionally, the professor explains more in detail of what he expects us to do in the assignments. Therefore, without going to lectures, my performance in the course would be very poor. So I agree with my week 4 blog post when I said that going to lectures would drastically improve my performance in the course.

Looking back at my previous SLOG, I agree with the blogger with the link (http://dingtaoliu.blogspot.ca/2015/03/csc148-marth-30th-2015.html). Similar to this blogger, we both now realize that drawing trees and understanding what each step of the tree should return is very important and useful when solving a problem in involving recursion. We both are looking back and laughing at how we used to rush into writing recursive code without fully understanding the problem. Similar to this blogger, I too used to guess and check when solving recursive algorithms. I used to write up something related to what we did in lecture and hope it would work in lab questions, which is quite foolish. Furthermore, I also agree with the blogger when he says that the best way to think about recursive algorithms is understanding the fact that whatever the recursive code asks it's children, it will also ask it's grandchildren and so on. So it is best to think of only one relation, rather than tracing through the entire true manually.

I am glad that my experiences of looking back are similar to the blogger (http://dingtaoliu.blogspot.ca/2015/03/csc148-marth-30th-2015.html). It shows that we both learned a lot in the course and we both learned more efficient ways to tackle problems. I look forward to next week, as it is the last week of the course!

Saturday, 14 March 2015

Week 9 - Impressions of Week 8

This past week, we covered the topic of linked lists. Linked lists are made up of nodes, and each node refers to the next node in the list. I found this topic to be interesting. Even before the professor went into more depth about linked lists, I immediately began to think about how I would traverse through a linked list from the diagrams the professor drew showing the link between nodes. Each node refers to another node, so to traverse through a linked list, I learned that it is best to go through each node and the node behind it at the same time. One way to do this is by having initially setting current_node = lnk.front, where lnk.front is the first node in the linked list, and by setting previous_node = None. Then as long as there is a node in front of current_node, which would be current_node.nxt, we can set current_node = current_node.nxt and previous_node = current_node. I found this approach to be quite interesting, although it is very logical.

I really enjoyed working on the lab exercises after the lecture on Wednesday night. There were no labs this week, so I started to work on the lab exercises early to ensure that if there is a concept that I don't understand, I can speak with the professor late this week or early next week. One thing that I realized is that doing lab exercises the same day as the lecture is a lot more effective than doing them the night of the next day, because the material is fresh in my head. What I found even more effective is by re doing those lab exercises the next day to ensure that the material I covered is well understood. Although there were some functions that I was not able to implement on my own, I now understand the value of doing things early rather than leaving things to the last minute. Thanks to the fact that I spent a lot of time practicing by doing lab problems right after the lecture, I was able to gain a more solid and in depth understanding of how to traverse through linked lists. I was also able to seek help from the professor with the functions that I could not successfully implement at the end of last week, which got me well prepared for the test.

One thing that I will do in order to continue my improvement in the course is print out Final Exams from previous years on April 4 in order to practice the material covered all together in the course. I will continue to seek help during the professors' office hours when necessary, because they are like golden gems when we are stuck on problems. Firstly, they draw diagrams to ensure we understand what the problem is asking and what it should return in every step/how it should work. Secondly, they guide us through every step of the problem, so that we understand what the code does at every step of the way, and sometimes, they leave us with another very similar problem for us to think about as review for what we learned in their office. Office hours have really helped me understand multiple concepts, and I will continue to take advantage of the office hours when I am stuck on a problem. Although I feel as though I have a solid grasp on the material that has been covered thus far in the course, I believe it is essential to keep practicing by solving problems, so I will continue to do that often until the day of the Final Exam to ensure I don't forget anything.

My experiences in the course are similar to the blogger (http://5529405871.blogspot.ca/2015/03/week-8-linked-lists.html). Similar to this blogger, I also found the concepts of linked lists interesting, but challenging to implement at first. For each problem, I had to draw multiple diagrams first to visualize what my code should do, and then I started to write code. As time passed by, I found the material less challenging. Additionally, similar to this blogger, I also wish that my code was simple and elegant when implementing functions in Lab 7. Although I was happy that I was able to get many of my functions to work, I had a lot of unnecessary code in my solutions, which is something experienced with this blogger as well. It is interesting for me to see that this blogger has similar experiences to me as well, because it shows me that many of us have the same struggles and learning processes.

I can't wait till next week!

Saturday, 7 March 2015

Week 8 - Impressions of Week 7

This past week, we covered the topic of Binary Trees and Binary Search Trees. A binary tree is a tree where each node can have between 0 to 2 children. A binary search tree is a binary tree where the left sub-tree of each node has values that are always less than the node and the right sub-tree of each node has values that are always greater than the node. We also talked about how to write recursive code effectively when using using recursion on binary search trees.  I personally had trouble understanding how to use recursion on binary trees, and in order to understand the logic behind it, I had to think of a few examples and ask myself: How to solve these problems recursively. I saw that conceptually, it is not any different than a regular tree. The only difference is that binary trees can have at most two nodes, so instead of using a for loop to iterate over each child, we can call the recursive function on the left sub-tree, visit the node, and then call the recursive function on the right sub-tree.

We also talked about different ways to traverse through a binary tree. One method of traversal is called inorder. In this method, we first visit the left sub-tree, then the node itself, and then the right sub-tree. Another method is called preorder. In this method, we first visit the node itself, then the left sub-tree, and then the right sub-tree. Finally, we have another method called postorder. In this method we first visit the left sub-tree, then the right sub-tree, and then the node. These are three recursive definitions. Personally, I found it easier to remember the fact that no matter which method we are using, we always visit the left sub-tree before the right. Therefore, these three methods only differ by which position we visit the node. In preorder, the node is visited first, in inorder, it is visited second, and in postorder, it is visited last. This is how I remember the difference between these three recursive definitions.

One thing I will do to improve my performance in this course is help out some friends with course concepts that they have difficulty with, or problems in which they have trouble solving. Whenever I have trouble, I ask some friends to explain certain concepts to me. This helps me out a lot, and I've noticed that it also helps them improve their communication skills and the material that they explain gets reviewed in their heads as well. I believe that if I assist some friends with problems that they have had trouble solving, the material that I am assisting my friends with will never escape my mind, and it will also help me improve my communication and teaching skills. This will be the ultimate review, and it will help out somebody else as well. I also plan on solving as many problems as possible, whether they be from past tests, exams, or additional lab exercises, because although I may understand the concepts in the course, applying the concepts has always been a challenge for me, and in this course, applying the concepts we learned is essential.

I agree with the blog entry of (http://ak148slogaddress.blogspot.ca/2015/03/w8.html). Having a team for Assignment 2 really does help in getting a lot of the work done, because sometimes I might understand something that they don't and sometimes they may understand something that I don't. We can fill in each other's gaps and at the end of the day, we all end up learning something. Furthermore, I also feel as though I have learned a lot about object oriented programming, because whenever we get stuck on a particular concept, my group members and I help each other out, which is the same case with the blogger. We both have excellent group members who work with us not only on assignments, but also have discussions about course concepts and lab problems. I am glad the blogger is having a great experience in course, and I, along with the blogger, am thankful for having such a fantastic team to work with.

Saturday, 21 February 2015

Week 7 - My Summary of Recursion

One of the most important concepts of the course thus far is recursion. The concept of recursion can be simply stated as "defining something in terms of itself". In order to perform a task in a function, a function can simply call itself on multiple smaller instances of a problem in order to solve a big problem. This makes recursion a very powerful tool, as some of the most complicated problems can be broken into simple pieces, and these simple pieces can be put together like a puzzle to give a solution to the complicated problem, all by recursion.

In class, we have used recursion on trees. One way to think of recursion when working with trees is by assuming that it works for one level of the tree, say level n. If the recursive step solves the sub-problem from n to n+1, then we can assume that the recursive function works for all sub-problems of the tree. The concept of recursion is very similar to induction. We first check for the base case, and when writing recursive code, it is always best to check if the recursive function works for the base case. If it works for the base case, we check to see if the recursive step solves a problem correctly from one level of the tree to the next level, or as we can say, from one node to its children. If the recursive function successfully solves the problem from one level to the next, then we can assume it works for the entire tree.

When writing recursive code, it can be useful to remember a few steps:
1. Write what the function should return in the base case, or what it should return when the tree has no children when working with trees.
2. What it should do when the root of the tree has children.
3. The recursive step.

When the function reaches it's recursive step, the function will break the problem down into smaller pieces and solve the problem for each of it's children, until it finally arrives at the base case. Therefore, it is very important to ensure that the function does exactly what it should correctly for the base case.

So far, I have been working to understand the exercises in the lab hand outs and understand the examples that have been done in class by drawing out the trees, tracing through examples, and thinking about what I would need to do at each step in order to successfully implement a recursive function. I look forward to becoming a master at recursion in the coming weeks.

Saturday, 14 February 2015

Week 6 - Summary of Object Oriented Programming Concepts.

This week, I will give a brief summary on Object Oriented Programming. So far in CSC148, everything we have covered has to do with Object Oriented Programming. Object oriented programming is when programmers get to choose what data types are used, which data structures are used, and to apply functions and operations to those data types and data structures. A simple example of this is me creating a list of my grades in the form of numbers (that represent percentages), using a for loop (an operation) to iterate through each element in the list to sum the numerical grades together, storing the sum in a variable, and dividing it by the length of the list to come up with an average. This would return a float representing an average percentage grade. In this example, I got to choose the data structures that I want to work with and the operations I want to perform on the data structures.

Some main concepts of object oriented programming we have learned so far in this course are classes and subclasses. Classes are objects that define a set of attributes that characterize objects of the class. For example we can write a class called GameState, in which we would define a method called state_turn, which would return a string telling the player of any game whose turn it is. This class would contain multiple attributes that perform different operations relating to the play of any game. A subclass is a class that inherits the methods of a parent class, and may contain additional methods relating to something more specific. For example, we may have a subclass called TicTacToe(GameState), where the class GameState is the parent class and the subclass would be TicTacToe. The subclass TicTacToe would inherit all the methods of GameState, which contain methods relating to the play of any general game, and the subclass may contain additional methods that may relate to the game TicTacToe.

At this point in the course, I feel very comfortable with the object oriented programming concepts we have learned in this course. One thing that I can continue doing to improve my performance in the course is by starting to work on the lab exercises ahead of time. This week, I did not perform well on the quiz, but after completing the lab exercises today, I realize how easy the quiz was. Also, I realized that I need more than two hours to go through all the exercises in the lab and to understand in depth how each piece of code performs operations. By starting lab exercises Wednesday night, I will have sufficient time to understand all the material in the lab handout, thereby improving my performance in the quizzes.


Saturday, 7 February 2015

Week 5 - Experiences and Summary of Abstract Data Types.

This past week was an interesting week. The lectures ended quite early, and we were introduced to two new Abstract Data Types in Python. We were introduced to Stacks and Queues. The concepts weren't too difficult to grasp during lecture. I learned that a stack is a collection of items, meaning that it has multiple elements. This can be compared to lists and dictionaries, which can also contain multiple elements. We talked about some interesting basic operations that stacks have.
These include:
1. Stack(), which creates a new stack. New stacks are usually stored in a variable, so if I were to create a new stack, I would write: stack = Stack().
2. is_empty(), which checks to see if the stack has any elements. This method has a boolean return type, and returns True if and only if the stack has no elements. When calling this method, I would write: stack.is_empty().
3. push(item), which pushes an item to the top of the stack.
4. pop(), which removes and returns the item at the top of the stack.

Stacks follow the last in first out protocol. This means, that whatever has been pushed last is the first to be removed when we choose to remove an element from the stack.

Queues, however, follow the first in first out protocol. Basic operations of Queue include:
1. Queue, which creates a new queue.
2. enqueue(), which adds an item to the back of the queue
3. dequeue(), which removes an item from the front of the queue.

Queues follow the first in first out protocol. This means that whatever was added to the first in the queue is the first to be removed when we choose to remove an element from the queue.

I did not perform well in the lab as I hoped I would. I showed up to the lab on time and I did the basic exercises in the lab that were assigned. I got a basic understanding of how to write methods in class Stack and class Queue, and I got a basic understanding for their operations. However, I did not do the additional exercises, which required us to trace what some functions implemented in the lab would do with complicated lists (the functions being stack_list and queue_list). Regardless of what the operations of those functions are, while doing the quiz, I realized that to gain a solid understanding of what is required in the course, I should work on the additional lab exercises. This is what I will do from now and on to improve my performance in the lab quizzes and to gain a solid understanding of what is required in the course.

My experiences in the course is similar to that of the blogger with the link: (http://2ne1bigbangexosuperjuniorbts.blogspot.ca/2015/02/week-5-slog.html). Similar to this blogger, I too was excited when I heard that we would be allowed an aid sheet for the test, but while writing the aid sheet, I felt as though what I am writing is already in my brain. I felt as though the best way to prepare for the test is by re doing lab questions for practice, and working on the additional lab exercises. Similar to the blogger, I didn't read the aid sheet during the test because everything was already in my brain. I agree with the blogger when he/she says that the purpose of allowing an aid sheet is to help us review for the test, not to help us cheat on the test by looking at a secondary source.

I am looking forward to a fantastic next week!

Friday, 30 January 2015

Week 4

The past few weeks of the course have been interesting. The main concepts we have covered in the course at this point are classes and inheritance. We talked about what classes are, when and how they are used, some essential methods that we should include, and we talked about inheritance.

Inheritance is a powerful topic that has been covered, because it can save a lot of time. When a class inherits methods of a another class, the inherited class can be referred to as a subclass, and the class that has been inherited can be referred to as the parent class. Inheritance can be used to save a lot of code writing that would be redundant, thus saving time. This is what makes inheritance very convenient. For example, if I want to create multiple games, many game classes would have methods that are the same, such as a method to determine whose turn it is. We can create a general game class that has a method to check and display whose turn it is, and we can have specific game classes inherit the methods of the general game class. this way, we wouldn't have to rewrite the method that checks/displays whose turn it is, saving us time.

One thing I can do to improve my performance and understanding of the course is to go to labs on time. I have been late to the last few labs, and I think that being late has prevented me from finishing the exercises in the lab handout. This has resulted in me not fully mastering the material I am expected to know, which is reflected in my poor performance in the quizzes. I believe that by going to the labs on time, I will have sufficient time to complete the lab handout, and I will do better on the quizzes, and I will gain a mastery of the weeks' material.

In addition, I can also improve my performance in the course by going to all of the lectures. After the first week of classes, I thought that going to lectures is not essential because the professor always posts his slides on the webpage. Therefore, I skipped a lecture in week 3 and week 4. I tried to go back to the lecture slides and the code done in class to learn the material by myself, but without the explanations, it was harder to catch up on the material and learn what had been taught. I wasted a lot of time figuring out what had been taught. I learned that it is essential to go to lectures because the explanations of the professors are very good, and without those explanations, it is difficult to understand the purpose of the code written and posted in the course website. Thereby, I believe that by attending all lectures, my performance in the course will drastically improve.

My experiences in the course are similar to that of the blogger with the link in brackets: (http://aktrancsc148.blogspot.ca/2015/02/week-4.html). I agree with the blogger when he/she says that so far, the material isn't too difficult to learn and I also agree with the blogger when he/she says the first assignment is difficult to plan out because there is no starter code provided. I haven't performed well in the quizzes due to my procrastination in reading lecture slides and attending labs late, but once I finished the lab exercises after the lab, I found the material not too difficult to grasp. Additionally, I have been used to getting starter code in CSC108 in my assignments. Thereby, without starter code, it was difficult for me to think of how to implement the game using classes, and to plan out the assignment. This is something that I will have to get used to in CSC148, because I am assuming that we are now expected to become independent and write programs on our own, without getting starter code to point us in the right direction. This is good, because it helps us become more independent.

I am looking forward for a fantastic week.

Wednesday, 21 January 2015

SLOG 1 - Why Geeks Should Write

In the modern world, there seems to be nothing more important than being able to write. Effective writing gives us the ability to communicate our ideas clearly to the reader, helps us to better understand a topic, and gives us means to review particular concepts or adventures that we have gone through in the past that may be useful to us in the future.

One reason why geeks should write is because writing gives us the ability to communicate a message or a lesson across to the reader in a clear and fashionable way. Whether it is writing about a war in history, explaining how to build your own model rocket in an instuction manual, or explaining what a particular line of code does in a computer program, writing can get our message across to the reader, who can use our message or instructions to learn something new, understand something that she could not comprehend before, or simply follow instructions. Clarity is very important, and effective and clear writing comes with practice. The more clear a piece of written work is, the easier it is for the reader to comprehend and make use of the written work. For computer scientists, writing is particularly important, because being able to explain what each line of code does in computer programs can be very useful when debugging code, or when working to make algorithms more efficient.

In addition, geeks should write is because writing can help us to better understand a topic that we may have had difficulty with. Sometimes we learn about complicated things in science, math, or any other subject area where we don't understand exactly what is going on or why something works in a particular way. When we finally understand something, writing down what we learned in our own words can help us to develop an understanding of that particular topic. Using examples and describing something in detail can help us to better understand a topic that we are trying to learn about and it can help us to retain what we are writing about in our long term memory. In particular, when reading mathematical proofs, sometimes it can be difficult to decode all the mathematical symbols, making it difficult to go through and understand the proof, especially to individuals like me who are new to proofs. Translating these proofs in clear and concise sentences, and writing some proofs in our own words can help us to better understand why a particular theorem or statement is true, and where and how each line of the proof comes from.

Furthermore, geeks should write about their past experiences, and how they overcame problems and obstacles in their lives. This can be very useful, because when we are faced with some of the same obstacles again, we can go back to our journal, or wherever we may have written about our past experiences, and look at how we have dealt with our problems in the past. We can take a look to see what worked and what didn't work, so when tackling a particular problem again, we can tackle it with greater efficiency. One example can be keeping a log on tracking down bugs. It can be very useful to always write a journal about what bugs we may have had to track down throughout our career, and what approach we used to track them down. When faced with a similar challenge in the future, we can go back to our journal to see what worked and what didn't, and we can use a more efficient approach using our past experiences to track down a bug. Referring to a past journal on how we may have successfully fixed/tracked down a bug in the past can be particularly useful when we are stumped and don't even know where to begin!