from random import random

def moyenne(n):
    T = 0
    for k in range(n):
        s = 0
        i = 0
        while s < 1:
            s += random()
            i += 1

        T += i

    return T / n
