solutions added to cachematrix.R

completed as part of assignment #2 in "Programming in R".