calculate pi by simulation