I think I mistakenly covered the wrong topic last week. I was suppose to write my impression of the first few weeks doing SLOGs but instead I spoke about recursion, which is technically this week's topic. So I will do what I had to do last week in this week, and I hope that what I did last week would suffice for this week's requirements.
If your refer to my first post, you will see that I stressed many times how this is my first attempt at anything close to blog. I realized I haven't gotten any feedback from other people. This may be because my writing is not interesting enough or no one is clicking on my url slog that is posted in the CSCA148 course website. Regardless, I feel that doing these SLOG's is helping me in many ways. First of all, it is allowing me to show my understanding, both to myself and to my TAs. Second of all, throughout the week, this course is a priority to me but other courses do take up my time. Having to do these SLOGs reminds my brain of all the work that I have done up to that point. This is kind of like a refresher. Lastly, I believe that these SLOGs allow me to see what my peers think, and if they experience similar concerns as I do. I sometimes look at their SLOGs to see how they overcame those issues.
With that being said , I would really like to give out a shoot out to: http://sarcasticgradientdescent.blogspot.ca/
This individual has some excellent work, and I usually look into his SLOG when I am having troubles understanding a certain topic. I highly encourage for whoever that is reading my blog to also check out his!
Sunday, 8 February 2015
Monday, 2 February 2015
Week 4: Recursion
This week's topic is going to be a continuation to lasts week's topic: Recursion. Last time I spoke about it I felt I was rushing the topic too much, but hopefully today I can elaborate on this matter. In the previous slog of mine, I tried to illustrate recursion through the an example where we had to gather all possible blood types for individuals across Canada. I will start by reexplaining the example and mentioning key terminology that I may have missed last time. Then I will talk about some things we covered in Week 4's lecture.
In the blood type example I tried to show a possible method, recursion, as a solution to a problem of determining what blood type everyone in Canada has. The idea is that we are dealt with a vast number of people, but each of these people are split into sub amounts of people in each province. Furthermore, we can yet again separate people by regions they live in within each single province in Canada. The pattern of taking the current problem and separating into similar problems, but smaller in size, is the idea of recursion. This circular method has to has a limit, or else we would go on forever. This limit is what we call a base case. In the previous example, I don't recall saying a base case. I think the base case in reality would be till we hit certain postal codes where we can send people to a near by school to register their blood type. It would be ideal that our base case would be the actual person, but there would be no affordable way to execute that in real life. Being that we are on a budget, as seen in the real world, I would determine that the base case would be the community surrounding the schools. From there the method would be forced to exit from its current recursive stage as it has hit the predetermined base case we placed in the function.
The preceding paragraph raised a couple concerns for me when I was writing, but I feel I should discuss them now. The professor also illustrated this concern which was what would happen if we never hit the base case. The answer seems pretty straight forward because it just implies the function will never exit itself. It will keep trying to keep converting the bigger problem into a smaller problem. An infinite loop that is missing a base case. I found the example Danny used with the turtles were very helpful.
I will write sooner next time, probably after the midterm. I will need to vent all my thoughts :P.
Have a goodnight everyone!
In the blood type example I tried to show a possible method, recursion, as a solution to a problem of determining what blood type everyone in Canada has. The idea is that we are dealt with a vast number of people, but each of these people are split into sub amounts of people in each province. Furthermore, we can yet again separate people by regions they live in within each single province in Canada. The pattern of taking the current problem and separating into similar problems, but smaller in size, is the idea of recursion. This circular method has to has a limit, or else we would go on forever. This limit is what we call a base case. In the previous example, I don't recall saying a base case. I think the base case in reality would be till we hit certain postal codes where we can send people to a near by school to register their blood type. It would be ideal that our base case would be the actual person, but there would be no affordable way to execute that in real life. Being that we are on a budget, as seen in the real world, I would determine that the base case would be the community surrounding the schools. From there the method would be forced to exit from its current recursive stage as it has hit the predetermined base case we placed in the function.
The preceding paragraph raised a couple concerns for me when I was writing, but I feel I should discuss them now. The professor also illustrated this concern which was what would happen if we never hit the base case. The answer seems pretty straight forward because it just implies the function will never exit itself. It will keep trying to keep converting the bigger problem into a smaller problem. An infinite loop that is missing a base case. I found the example Danny used with the turtles were very helpful.
I will write sooner next time, probably after the midterm. I will need to vent all my thoughts :P.
Have a goodnight everyone!
Subscribe to:
Posts (Atom)