Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pearls in the Box by tarasenkoa
def checkio(m, step):
p = m.count("w") / len(m)
for i in range(1,step):
p = (p - 1/len(m))*p + (p + 1/len(m))*(1-p)
return round(p,2)
June 22, 2015