Execute associative and distributive properties to matrices.