from math import *
from random import *

def Distance(n):
    somme=0
    for k in range(n):
        a=randint(-2,2)
        x=3*a
        somme=somme+x
    m=somme/n
    d=abs(m-2)
    return d

def Répétition(N,n):
    s=sqrt(18)
    r=0
    for j in range(N):
        if Distance(n)<=2*s/sqrt(n):
            r=r+1
    p=r/N
    return p


