import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt

def experience(n):
    maxi=n
    res=0
    while maxi>0:
        res+=1
        maxi=rd.randint(1,maxi+1)-1
    return res

def moyenne(n):
    somme=0
    for i in range(100*n):
        somme+=experience(n)
    return somme/(100*n)


Lx=[k*100 for k in range(1,10)]
Ly=[moyenne(x) for x in Lx]
Lz=np.log(Lx)
plt.plot(Lx,Ly)
plt.plot(Lx,Lz)
plt.grid()
plt.show()
