cachematrix.R

Coursera explanations added as comment