CoCalc Shared Filesbirthday.ipynbOpen in CoCalc with one click!
Author: Brian Erickson
Views : 10
Description: Jupyter notebook birthday.ipynb
In [24]:
def birthday(n): if n == 0: return 0. l = birthday(n-1) return l + (1-l)*(n-1)/365.
In [25]:
birthday(1)
0.0
In [26]:
birthday(2)
0.0027397260273972603
In [27]:
birthday(17)
0.31500766529656066
In [28]:
birthday(22)
0.4756953076625501
In [29]:
birthday(23)
0.5072972343239854
In [30]:
birthday(30)
0.7063162427192686
In [31]:
birthday(365)
1.0
In [ ]: