The term has came to an end I think I should look back for a bit now.
What I learned from the course, in my opinion, are: how to use ADT, how to creative a useful class, how to write recursive functions, how to solve problems like a tree(tree, binary tree and linked list). I think the biggest difference from the CSC108 is that this course is abstract! We used something that we can not understand fully(ADT), and we write some functions(recursive functions) that are not very straightforward. I think when it comes to higher years, this skill to use abstract things are really important to us.
I have some hurdles, of course. Some are from assignments, others may come from tests.
As for assignments, I found sometimes my code is really not efficient. Sometimes even the codes can run, but they are not reasonable and require a lot of work once I want to revise it, and it may be impossible for my friends to understand my codes. I think that is a real problem so I looked at my friends' codes and teachers', then I improve my codes a lot, especially in class design.
As for tests, I at first can not understand the order, and arity. Then I referred the lecture notes and found the code for all orders. By reading the codes, I got to know the meaning of all the orders. As for the arity, I don't think the notes are specific enough for it, the concept is really ambiguous, in my opinion. So I asked my friends and they told me it is the max the tree can hold, not the max it really has.
As for the course events, I think the one which was most unforgettable was the test 1. Indeed, I wrote the right code for the program. However, it was not a reasonable one as it will be really bothering to revise my code as it is not general enough. In this case, I got about 20 mark lower than what I thoght I should get. This is painful, but it educated me a lot as well.
The course really gives me a lot and hope I will get good grades at the end of the semester XD
class Slog
Wednesday, 15 April 2015
Monday, 30 March 2015
Week 11: Revisit and reconsider
This week's mission is to look back one of my earlier work, so I chose to revisit my week 6's slog.
I found the topic was about how to write recursion and the result of the test 1.
As for the first part, I agreed with most of what I said. But I also think it was too narrow and not complete enough. During those weeks, I found the most important thing was to understand the recursive part, which means, what was called again and again. If I can not understand what part I repeat over and over again, the function would definitely be in a mess. So drawing a picture is vital as it will help me to understand the process of the function, which is most important.
Understanding the algorithm before writing the function. That is what I learned from writing recursion function, which, in my opinion, is also of great importance for writing other complex functions as well.
And as for the test 1, in week 6, I still think what I've written is OK. However, during this week, I found that if I don't use a systematic way to write functions, even though it works for the problem itself, it can make me impossible to go further. By working on those assignments, I really understand why our instructor urge us to so like him. The systematic way he told to us can really avoid us from getting into mess. Also, I found I mistakenly understood how I should learn this course in the week 6's slog. During this week, I found myself not hard-working enough, I seldom worked on the extra exercise. That made me not so familiar with what we had learned. And in this case, even I knew how to deal with the problems on test 2, as I was not so familiar and under stress from the test, I did really bad at the test 2. That really made me sad. In the coming weeks, I think I will practice more to get what I want in the final.
I've looked for my classmate chirstiangarcia's slog as well. (http://christiangarciacsc148.blogspot.ca/)
This slog was really an excellent job! From his slog, I found that he also had a lot to say about recursion. He think that there are some certain frames for the recursion functions. And list out some of them. To be honest, I don't think always looking for framework is a good idea, as there are so many different cases. However, her ideas of summarizing really makes me think. It is a really good way to learn not only CSC but also other courses.
By the way, I've looked many urls on the slog lists. Some of them even doesn't include the week 11's slog and made me difficult to find a slog which I can refer to, but this one is like a real treasure for me. I think I can learn a lot from this slog. And I also strongly recommend this slog to everyone!
I found the topic was about how to write recursion and the result of the test 1.
As for the first part, I agreed with most of what I said. But I also think it was too narrow and not complete enough. During those weeks, I found the most important thing was to understand the recursive part, which means, what was called again and again. If I can not understand what part I repeat over and over again, the function would definitely be in a mess. So drawing a picture is vital as it will help me to understand the process of the function, which is most important.
Understanding the algorithm before writing the function. That is what I learned from writing recursion function, which, in my opinion, is also of great importance for writing other complex functions as well.
And as for the test 1, in week 6, I still think what I've written is OK. However, during this week, I found that if I don't use a systematic way to write functions, even though it works for the problem itself, it can make me impossible to go further. By working on those assignments, I really understand why our instructor urge us to so like him. The systematic way he told to us can really avoid us from getting into mess. Also, I found I mistakenly understood how I should learn this course in the week 6's slog. During this week, I found myself not hard-working enough, I seldom worked on the extra exercise. That made me not so familiar with what we had learned. And in this case, even I knew how to deal with the problems on test 2, as I was not so familiar and under stress from the test, I did really bad at the test 2. That really made me sad. In the coming weeks, I think I will practice more to get what I want in the final.
I've looked for my classmate chirstiangarcia's slog as well. (http://christiangarciacsc148.blogspot.ca/)
This slog was really an excellent job! From his slog, I found that he also had a lot to say about recursion. He think that there are some certain frames for the recursion functions. And list out some of them. To be honest, I don't think always looking for framework is a good idea, as there are so many different cases. However, her ideas of summarizing really makes me think. It is a really good way to learn not only CSC but also other courses.
By the way, I've looked many urls on the slog lists. Some of them even doesn't include the week 11's slog and made me difficult to find a slog which I can refer to, but this one is like a real treasure for me. I think I can learn a lot from this slog. And I also strongly recommend this slog to everyone!
Sunday, 22 March 2015
Week10: A start of A3 and something about variable name
There are no tutorials, no assignment dues, no tests during this week, so this week was not so tough.
During the lectures, I got some information about the assignment 3, and I also learned something about the variable name.
As for the assignment 3, there are two ways to finish this assignment, but in either way, we should learn how to reduce the runtime by avoiding some useless steps. Indeed, when I used my recursive functions, it ran really slowly and in this case, I never succeeded in running a 4 * 4 grid. These improvement will help our functions to work better, and maybe that will make it possible for our functions to run in a 4 * 4 grid. In fact, I have some questions about how to judge whether an improvement can reduce the runtime considerably. I think we will soon learn how to do it.
And as for the variable name. I learned that the if we set a global variable A, and we also set a parameter A for a function. then the function will first refer to the parameter A, rather than the global variable A. That is vital for us, as this may lead to some unexpected error during the running of the program.
The problem I encountered during this week was that I didn't know how to calculate the runtime. I asked one of my friend who had this course before. He told me that I just need to approximately determine what type the function was, and didn't have to add every constant, that made me feel much easier to calculate the runtime.
The problem I encountered during this week was that I didn't know how to calculate the runtime. I asked one of my friend who had this course before. He told me that I just need to approximately determine what type the function was, and didn't have to add every constant, that made me feel much easier to calculate the runtime.
This week is kind of vacant and maybe next time, I should do something by myself to get some improvement. I tried to read the required reading, but just found out that it was kind of difficult for me to understand the documentation. The notes are easier to understand, but now we have no notes. I think maybe the instructor can give us more notes to help us to learn, that will be helpful.
Sunday, 15 March 2015
Week9: Term test 2 week!
This week we had the term test 2, which was about some definitions about tree, recursive functions and linked list.
As for the definitions, I think I understood most of them, however, after checking answers with my friends, I found out that I had some misunderstanding about the arity. The arity of a tree is the max number of nodes of any trees. It means that I should find the node who has most children and count the number of its children. In the past, I thought arity represents the number of children a node can hold, which was wrong!!!
As for recursive functions, I found that although in most cases, I could work out recursive functions, under the stress of test, I become too nervous to do anything. That means my understanding of recursive functions is not good enough, otherwise, I should have worked it out easily. I should practice more to understand recursive functions better, rather than just memorizing.
In fact, I found I did really badly in linked list. It was obvious that I didn't understand the model at all!
So I found a way to deal with it. I asked some of my friends who had worked with linked lists before. They told me I had two methods to deal with linked lists. First, I may take care of my order, which can help me not to lose the front or the back of a linked list. Second, I can copy or store the front or back in advance, then I can do something to the linked list and then find back the front or back. These methods sounds good, but I still have many problems. Since there is no TA, I think I'd better ask my friends more about the method to deal with linked lists.
As for the definitions, I think I understood most of them, however, after checking answers with my friends, I found out that I had some misunderstanding about the arity. The arity of a tree is the max number of nodes of any trees. It means that I should find the node who has most children and count the number of its children. In the past, I thought arity represents the number of children a node can hold, which was wrong!!!
As for recursive functions, I found that although in most cases, I could work out recursive functions, under the stress of test, I become too nervous to do anything. That means my understanding of recursive functions is not good enough, otherwise, I should have worked it out easily. I should practice more to understand recursive functions better, rather than just memorizing.
In fact, I found I did really badly in linked list. It was obvious that I didn't understand the model at all!
So I found a way to deal with it. I asked some of my friends who had worked with linked lists before. They told me I had two methods to deal with linked lists. First, I may take care of my order, which can help me not to lose the front or the back of a linked list. Second, I can copy or store the front or back in advance, then I can do something to the linked list and then find back the front or back. These methods sounds good, but I still have many problems. Since there is no TA, I think I'd better ask my friends more about the method to deal with linked lists.
Sunday, 8 March 2015
Week8: Assignment2 about recursion and class design
The due date of assignment 2 is this Thursday, so we worked on assignment 2 this week.
I learned two main contents in the assignment.
First, more about the class design. During the assignment 1, I learned something about class design. However, I even learned more by referring to instructor's code. First, I learned that we don't need to implement a method to play game under GameState, rather, we should implement the play method under the GameView to ensure this play method can work for more game. GameState is just a class to represent a state, we just use these states under the GameView. Second, I learned that most games should have similar methods like possible_next_moves, apply_move. This can help us to play a lot of games by just implementing one GameView. In the last assignment, I obviously didn't find out many share characteristics between one game and another one.
Then, I understand recursion more. I get to know two new essential rules to make my recursion work. The first one is that I should get to know what requires the recursion, in this assignment, the return of the state or move itself, in fact, doesn't require recursion. The thing which requires recursion is the calculation of the score. Knowing what really requires recursion makes our recursion much easier. The second thing is that drawing a picture is a really good way to help us to understand recursion. At first, I didn't care about the picture on the handout. And that makes me waste a lot of time as I didn't have a method to solve the problem and I just tried over and over again. After considering about the picture carefully, I got to under the instructor's method and then it just took a few time for me to work out the problem.
I learned two main contents in the assignment.
First, more about the class design. During the assignment 1, I learned something about class design. However, I even learned more by referring to instructor's code. First, I learned that we don't need to implement a method to play game under GameState, rather, we should implement the play method under the GameView to ensure this play method can work for more game. GameState is just a class to represent a state, we just use these states under the GameView. Second, I learned that most games should have similar methods like possible_next_moves, apply_move. This can help us to play a lot of games by just implementing one GameView. In the last assignment, I obviously didn't find out many share characteristics between one game and another one.
Then, I understand recursion more. I get to know two new essential rules to make my recursion work. The first one is that I should get to know what requires the recursion, in this assignment, the return of the state or move itself, in fact, doesn't require recursion. The thing which requires recursion is the calculation of the score. Knowing what really requires recursion makes our recursion much easier. The second thing is that drawing a picture is a really good way to help us to understand recursion. At first, I didn't care about the picture on the handout. And that makes me waste a lot of time as I didn't have a method to solve the problem and I just tried over and over again. After considering about the picture carefully, I got to under the instructor's method and then it just took a few time for me to work out the problem.
Sunday, 1 March 2015
Week7: Summary on Recursion
I've been exposed to a new topic recursion for a few weeks and here is some of my understandings for it.
Why recursion works?
Recursion is not a magic and it is not a special grammar in python in my opinion, it is just about using the function over and over again just as the instruction the programmer gave, and at last, use the base case to solve it.
Are all the functions that contain themselves recursive function?
No! Sometimes, we may encounter with some __repr__ functions where there are another __repr__ in the function body. However, they are obviously not recursive functions. They are just using this function in other classes. A recursive function should contain a base case, so a good way to judge whether it is a recursive function or not is to find out whether it has a base case.
How to write a recursive function?
To write a recursive function, we can trace back. However, it is not so easy to write a recursive function in this method. Rather, we first think about the base case. We think about the simplest case where no recursion is required to write the base case. And then, we can regard those function calls for simple cases as what we already know and try on cases which just requires one recursion. At last, We may trace back to see whether our function works.
Above are some of my understands for recursion. Although I get used to recursion to some degree, I still have troubles dealing with recursive functions. I think the way to solve it is to try on more lab problems and ask my friends and TAs(Hope we will have TAs help us soon)
Why recursion works?
Recursion is not a magic and it is not a special grammar in python in my opinion, it is just about using the function over and over again just as the instruction the programmer gave, and at last, use the base case to solve it.
Are all the functions that contain themselves recursive function?
No! Sometimes, we may encounter with some __repr__ functions where there are another __repr__ in the function body. However, they are obviously not recursive functions. They are just using this function in other classes. A recursive function should contain a base case, so a good way to judge whether it is a recursive function or not is to find out whether it has a base case.
How to write a recursive function?
To write a recursive function, we can trace back. However, it is not so easy to write a recursive function in this method. Rather, we first think about the base case. We think about the simplest case where no recursion is required to write the base case. And then, we can regard those function calls for simple cases as what we already know and try on cases which just requires one recursion. At last, We may trace back to see whether our function works.
Above are some of my understands for recursion. Although I get used to recursion to some degree, I still have troubles dealing with recursive functions. I think the way to solve it is to try on more lab problems and ask my friends and TAs(Hope we will have TAs help us soon)
Sunday, 22 February 2015
Week7: Reading week! And a time to consider about assignment 1.
This week is reading week so there is no lecture. But during this week, the result of assignment came out.
The result is not so bad, but there are some mistakes I should reflect on,
The strength of my assignment is that I can write the game well, getting 100% in the game itself. Also, the gameview is clear and it scored a full mark as well.
However, I made lots of mistakes on the details.
First, my style is just passable, which means my docstr is not good. I think the way to solve this problem is to write the docstr when I am writing the function. Never complete the docstr after completing all the program. Docstr is not a grammar requirement, instead, it is something that helps us to write the function. So I should write docstr while I am writing the function.
Second, the special method is also just passable, which means that I didn't understand all the special method very well. And that is a problem I cannot solve just by myself. So I think I should ask for TA for help after the reading week.
Third, the strategy is not so good. I know my strategy can run, but maybe there is not good for implementing new strategies. The may affect my performance in the assignment 2 if I don't know what wrong is going on. So I should ask for TA before I start assingment 2. Also, I believe someone else must also make mistakes like this, so maybe I can refer to piazza.
In conclusion, writing program itself is not a real problem for me now. However, how to write program like a computer scientist, how to write it in a wise way are real problems for me!
The result is not so bad, but there are some mistakes I should reflect on,
The strength of my assignment is that I can write the game well, getting 100% in the game itself. Also, the gameview is clear and it scored a full mark as well.
However, I made lots of mistakes on the details.
First, my style is just passable, which means my docstr is not good. I think the way to solve this problem is to write the docstr when I am writing the function. Never complete the docstr after completing all the program. Docstr is not a grammar requirement, instead, it is something that helps us to write the function. So I should write docstr while I am writing the function.
Second, the special method is also just passable, which means that I didn't understand all the special method very well. And that is a problem I cannot solve just by myself. So I think I should ask for TA for help after the reading week.
Third, the strategy is not so good. I know my strategy can run, but maybe there is not good for implementing new strategies. The may affect my performance in the assignment 2 if I don't know what wrong is going on. So I should ask for TA before I start assingment 2. Also, I believe someone else must also make mistakes like this, so maybe I can refer to piazza.
In conclusion, writing program itself is not a real problem for me now. However, how to write program like a computer scientist, how to write it in a wise way are real problems for me!
Subscribe to:
Posts (Atom)