import numpy.random as rd 

def EML(n):
    b = 1
    r = 2
    s = 0
    for k in range (1,n+1): 
        x = rd.randint(1,b+r+1)
        if x > b: 
            s = s+1
            r = r+1
        else: 
            b = b+1
    return(s)

n = 10
m = 0
for i in range(1000): 
    m = m+EML(n)
print(m/1000)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: