SMS dit: Generalized inverse of matrices and its applications