Understanding Lexical Scoping

understanding lexical scoping using the concept of caching matrix