I was referring to this lecture Markov Chain Monte Carlo. However, I didn't get how the $\pi$ value was calculated. Here is a screenshot
As far as I know the integral gives the area under the curve. So I didn't get how the double integral is giving the value of $\pi$ using $P(x,y)$.
Also how did it convert to mean in Octave. I am just a beginner. So please some guidance is required