First version - matrix inverse

First solution based mainly on example given in assignment notes (cached mean value of a vector).