Sunday, 1 December 2013

#12 Topics covered in the last week

Map Reduce

As discussed in lecture slide, map reduce is sort of like list comprehensions. By introducing the concept of Map Reduce, we can combine iterables into a single reduced value. The basis of this concept is that many computations conducted can be treated as parallel such that we can reduce. For non-parallel computations, this concept may not apply. Just like the examples of list comprehensions, we generalize a list using a single expression, all the elements that will be generated can be treated as 'parallel' since the operations used to generate those elements are identical.

Tracing

We were introduced the following terminologies:
Local, Non-Local, Global.
Fairly simple concepts that were explained through a comprehensive example in class. Basically Global is variables that's in the global scope. Local only refers to the scope where the variable is evaluated. If a local variable that sits in global scope, then it is also a global variable. Finally, Non-Local refers to variables that sit one level above the current scope. For example, in the case of a helper function, a Non-Local variable would refer to the variable that sits in the function which calls the helper function.

Finally, Memorization

I previously employed this concept in Assignment 1. Basically this allows us to omit the redundant recursion calls by which we reduced the demand for the computer to compute and improve on efficiency. In assignment 1, I built a dynamic memory which memorizes the best cuts for cheeses starting for 1 cheese to n cheeses. By doing so I was able to find out the best cuts very easily based on the previous computations and utilized the information in execution. This is a great tool that we can use to reduce the unnecessary computations.

No comments:

Post a Comment