prog for computing inverse of matrix

the program has two functions taking advantage of lexical scoping to get
already computed result from cache