Here's the code that we're running in the notebook.
import numpy as np
import matplotlib.pylab as plt
def calculate(room = 20):
return 1 - np.prod((365 - np.arange(room))/365)
plt.plot([calculate(r) for r in range(1, 35)], label="calculated")
birthday problem: calculating
Here's the code that we're running in the notebook.
import numpy as np
import matplotlib.pylab as plt
def calculate(room = 20):
return 1 - np.prod((365 - np.arange(room))/365)
plt.plot([calculate(r) for r in range(1, 35)], label="calculated")