R script to inverse a matrix modified from coursera cachevector code.
Final version with example at the bottom hashtagged.