from math import *
from random import *

def X():
    a=random()
    if a<=0.1:
        x=1
    if a>0.1 and a<=0.5:
        x=3
    if a>0.5 and a<=0.9:
        x=4
    if a>0.9:
        x=6
    return x

def Moyenne(n):
    somme=0
    for k in range(n):
        somme=somme+X()
    m=somme/n
    return m

def Distance(n):
    e=3.5
    m=Moyenne(n)
    d=abs(m-e)
    return d

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


