from random import random

def approxPi(n):
    c = 0
    for k in range(n):
        x = 2 * random()
        y = 2 * random()
        if ( (x-1)**2 + (y-1)**2 )**0.5 <= 1:
            c = c + 1

    f = c / n # fréquence de points à l'intérieur du disque
    print( 4*f )

