Monte Carlo theory, methods and examples