Friday, February 28, 2014

Week 7: Recursion

Recursion is a programing technique that uses the function being defined within the definition of that function.  It allows a programmer to break a problem into smaller sub problems that are solved in a similar fashion. 

Initially it may seem strange to use a function while defining it.  It is almost like a dictionary using the word within the definition of that word, but dictionary definitions are not like function definitions.  In a recursive function definition there is a smallest case where no recursion occurs.   Every other function call calls the function on the value before the one being called, and the one before that, and so forth, eventually reaching the smallest case.  Without the smallest case, the function would continue to execute until the maximum recursion depth is met, and then a runtime error would occur.

I like recursion because it makes solving problems easier.  You can use recursion if you can solve a smaller instance of a problem and then use that result to solve a larger problem.  I have found that a lot of problems can be solved in this way.  For example, fractals, Fibonacci sequence, Sierpinski triangles, and trees are all problems that can be solved with recursion.


I also like recursion because it is similar mathematical induction, which, as a math student, I am very used to dealing with.  In mathematical induction there is a base case (or smallest case) where what you are trying to prove is true and then you show what you are trying to prove is true for the n + 1th case by assuming it is true for the nth case.  If I get stuck when solving a problem that uses recursion I think about mathematical induction to get myself back to the right train of though.

Saturday, February 22, 2014

Reading Week

I am so glad it is reading week.  It is nice to have a break, relax, and catch up on some work.  After I caught up in all my other classes, I started to study for the midterm for this course.  So far I am not too concerned about the test.  I have kept up to date with all the work, for the most part I have understood what we have covered in lab and lecture, and the assignment and exercises have gone fairly well.

This week I am on vacation in Florida.  I love getting away from all the snow, the cold, and school.  The best part is I can do all the things I love: golfing, swimming, and beaching.  I am not looking forward to going home!

Saturday, February 15, 2014

Week 6: Halfway

This week in lecture we discussed trees.  This is the first week I feel completely confident in the material covered.

I didn’t really enjoy this week’s lab.  Unfortunately, my lab partner was away and the lab didn’t have much to do with namespaces (which is what I was hoping for).  And unfortunately, the exercises didn’t help me understand the functions zip, filter, any, and all.  I think it was because my replacement partner and I were focused on finishing the lab instead of learning the material.  Hopefully over reading week I will be able to figure these functions out!


Can you believe we are halfway through the semester now!  I am enjoying the course thus far, and I am looking forward to the next half of the semester! But before that, a much deserved break, READING WEEK!!!

Friday, February 7, 2014

Week 5: The Calm Before the Storm

This was a pretty calm week for me.  Of course, next week is going to be very busy!  There are always a lot of midterms and assignments due before reading week.  Luckily, I just finished the first assignment, so at least that is something off my to do list.  Overall, I didn’t think the assignment was too difficult, but it took me a long time to finish it.  Hopefully the next assignment will go faster.  The assignment definitely helped me understand how to trace recursion faster.  I am feeling much more confident with recursion this week. 

In lecture we began discussing naming.  I understand the concepts and I have gone over the example from class, but I still do not feel completely confident with the material.  The labs always help me understand concepts better, so I am looking forward to this week’s lab.  

Saturday, February 1, 2014

Week 4: Feeling Rushed

I have really enjoyed the labs in this course so far.  I like working with a partner (which is unusual for me) and learning from each other.  It helps me clarify concepts covered in lectures and practice coding.  My only concern is this week my partner and I didn’t finish the lab, so we didn’t cover some of the concepts.  After rereading the lab handout, the only topic I didn’t fully understand was the built-in function property.  I am going to have to do some research, go back through the notes, and practice using this function.  Hopefully next weeks lab will be a little bit shorter!


In lecture we discussed recursion.  I know recursion from another course, but I haven’t used it in a while.  In class I was having trouble tracing the code for the function tree_burst.  I didn’t have enough time to trace the code myself before we discussed the answer.  Going back over the problem now, I can trace the code quickly, I just felt very rushed in class.  That seems to be the theme for me this week in lab and in class: feeling rushed.