The monte carlo algorithm implementation under all sorts of problems