compute PI with Monte Carlo method