Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook birthday.ipynb

Project: AI
Views: 85
Kernel: Python 2 (SageMath)
def birthday(n): if n == 0: return 0. l = birthday(n-1) return l + (1-l)*(n-1)/365.
birthday(1)
0.0
birthday(2)
0.0027397260273972603
birthday(17)
0.31500766529656066
birthday(22)
0.4756953076625501
birthday(23)
0.5072972343239854
birthday(30)
0.7063162427192686
birthday(365)
1.0