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
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!
Thursday, 19 February 2015
Week 6: Recursion in a tree
This week we did more exercise on recursion. We used a tree model to understand recursion. And during this week I learned some new methods to deal with recursion problems.
First, just like using a tree, we need to draw a picture to help us understand recursion, otherwise it will be too abstract for us to understand.
Second, during solving the tree problems, I found that the easiest way to write a recursion function is: first, find the basic case. Then, go further, try a one-time recursion. Last, check whether this will work for more complicated data. This process simplifies writing a recursion function, thus making it easy for me to write it.
But I also encountered some problems. Sometimes I even cannot figure the base case. For example, sometimes some problems seemed to ask us to trace back from children tree to parent tree, but the base case cannot be when it comes to parent tree! So this case may bother me. I've handled a problem like this, but still really confused about it. I think a good way to overcome it is to practice more. Thus, I'm trying to find more exercise form lab to do.
Another problem is not about programming itself, it's about my learning style, I found that my answer for midterm was OK, but it was not so reasonable. Writing a function which can run is not a hard thing for me but thinking like a computer scientist is really a tough thing for me. I am so worried about that and am afraid this may make me lose lots of mark on the coming test. I think the best way to overcome the problem is to ask others more. Working out a function is far more from success, I should communicate more with others to find the most reasonable way to write a function.
First, just like using a tree, we need to draw a picture to help us understand recursion, otherwise it will be too abstract for us to understand.
Second, during solving the tree problems, I found that the easiest way to write a recursion function is: first, find the basic case. Then, go further, try a one-time recursion. Last, check whether this will work for more complicated data. This process simplifies writing a recursion function, thus making it easy for me to write it.
But I also encountered some problems. Sometimes I even cannot figure the base case. For example, sometimes some problems seemed to ask us to trace back from children tree to parent tree, but the base case cannot be when it comes to parent tree! So this case may bother me. I've handled a problem like this, but still really confused about it. I think a good way to overcome it is to practice more. Thus, I'm trying to find more exercise form lab to do.
Another problem is not about programming itself, it's about my learning style, I found that my answer for midterm was OK, but it was not so reasonable. Writing a function which can run is not a hard thing for me but thinking like a computer scientist is really a tough thing for me. I am so worried about that and am afraid this may make me lose lots of mark on the coming test. I think the best way to overcome the problem is to ask others more. Working out a function is far more from success, I should communicate more with others to find the most reasonable way to write a function.
Sunday, 8 February 2015
Week5: Test1 and practice on ADT
During this week, the first test of CSC148 took place and it turned out that it mainly covered the design of creating classes.Also, on this week's lab, we started to use ADC like Stack and Queue.
Taking test is always a good way to find students' own weakness. And during this test, I find there is no big problem for me to implement an existing class but I am really not good at designing a new class to solve problems. For example, the question 1 really bothered me and it really took myself to work out it. From this test, I get to know I should really do more exercise on designing class, my weakness is not about programming itself but about how to transfer a task faced by human to a model that the computer can solve.
And during the lab, I started to work on ADT, Queue and Stack. I've learned some concepts about ADT in the lecture but found it difficult to use an ADT, and couldn't understand why we should use ADT.
During using it, I found the key to use an ADT is to use its own method more. For example, as for Stack, we don't know how the elements are stored, in a list, or in a tuple? But it doesn't matter at all, we just use pop and push to delete or add elements.
And why should we use ADT? It just is like in our daily, we don't always use row material to produce products. We sometimes use semi-finished products to produce. And the ADT is just like a semi-finished product, we don't need to write the ADT by ourselves, but we use some ADT to make something more complicated and useful. The skill to use ADT is extremely important for a programmer, in my opinion. Otherwise, we have to always use the most basic method and function to work out everything, that would be really annoying when we deal with complicated problems.
Taking test is always a good way to find students' own weakness. And during this test, I find there is no big problem for me to implement an existing class but I am really not good at designing a new class to solve problems. For example, the question 1 really bothered me and it really took myself to work out it. From this test, I get to know I should really do more exercise on designing class, my weakness is not about programming itself but about how to transfer a task faced by human to a model that the computer can solve.
And during the lab, I started to work on ADT, Queue and Stack. I've learned some concepts about ADT in the lecture but found it difficult to use an ADT, and couldn't understand why we should use ADT.
During using it, I found the key to use an ADT is to use its own method more. For example, as for Stack, we don't know how the elements are stored, in a list, or in a tuple? But it doesn't matter at all, we just use pop and push to delete or add elements.
And why should we use ADT? It just is like in our daily, we don't always use row material to produce products. We sometimes use semi-finished products to produce. And the ADT is just like a semi-finished product, we don't need to write the ADT by ourselves, but we use some ADT to make something more complicated and useful. The skill to use ADT is extremely important for a programmer, in my opinion. Otherwise, we have to always use the most basic method and function to work out everything, that would be really annoying when we deal with complicated problems.
Sunday, 1 February 2015
Week4: A totally new method to write function:recursion and a week for assignment1
This week is nearly a week for CSC148 as the main topic for the whole week is to work out the assignment 1, and during this week we also learned a new method to write function: recursion.
The assignment 1 makes me have a better understanding of creating a new class.
First, I began to understand why we should implement some special method. At the beginning, I can not understand why should we write something like __str__, __repr__ and __eq__, but during the assignment 1, I found myself easy to get confused when working on an object. An object is abstract, so we must write something to description it, like __str__ and __repr__, __eq__ also helps us to keep track of the object by differentiating different objects.
Second, I get to know how a game should be like. We create some objects to keep track of some data we need, and we should write a method for the class to help it transfer these data into some actions. In this way, we can make a game or something else.
We were also exposed to recursion this week. I had heard it from my friend before, and I thought it was a magic, I thought it was a special grammar for programming. But now I have some new understanding on it. Now I think it is not a real magic, it's just about using the programming language wisely, and now I think it is not so special, as it in fact doesn't contradict with what we learned before at all! I think a recursion is to repeat use the function over and over again and when it reaches its base case, it will work just as a non-recursion function. So tracing back is really a good way to understand recursion. It is just like the proof by induction in math, it is about using the base case to get to our destination.
Sunday, 25 January 2015
Why Geeks Should Write
January 25th, 2014
The purpose of writing, in my opinion, is to express the ides from inside to outside.
And when we express our ideas, we can express it to others, and also to our own.
When we express our ideas to others, it's a step for us to communicate with others and make them understand our thought. After that we can have interaction with other people, which makes gathering people's ideas possible. If we don't have connection with others or we can not understand each other at all, how can we gather our own ideas and generate a better idea from those ideas? So the use of expressing ideas to others is important as it can make a connection between people and generate better ideas.
Also, we express our ideas to ourselves. This is just like our slog. We change our mind over time, so it's important to keep track of our ideas at different moments. We collect different ideas from different times and then we can improve ourselves. We can compare what we thought yesterday with what we think today, then find the difference and think over which is better. That is the progress of improving ourselves.
In conclusion, writing is all about expressing ideas. We express our ideas to others to combine people's idea and generate better ones. We also express our ideas to ourselves to get to know our ideas over times and then we can improve ourselves.
So geeks should write to make them get better.
Well, slog is just doing those things, I think.
The purpose of writing, in my opinion, is to express the ides from inside to outside.
And when we express our ideas, we can express it to others, and also to our own.
When we express our ideas to others, it's a step for us to communicate with others and make them understand our thought. After that we can have interaction with other people, which makes gathering people's ideas possible. If we don't have connection with others or we can not understand each other at all, how can we gather our own ideas and generate a better idea from those ideas? So the use of expressing ideas to others is important as it can make a connection between people and generate better ideas.
Also, we express our ideas to ourselves. This is just like our slog. We change our mind over time, so it's important to keep track of our ideas at different moments. We collect different ideas from different times and then we can improve ourselves. We can compare what we thought yesterday with what we think today, then find the difference and think over which is better. That is the progress of improving ourselves.
In conclusion, writing is all about expressing ideas. We express our ideas to others to combine people's idea and generate better ones. We also express our ideas to ourselves to get to know our ideas over times and then we can improve ourselves.
So geeks should write to make them get better.
Well, slog is just doing those things, I think.
Wednesday, 21 January 2015
Subscribe to:
Posts (Atom)