yonlif

Birthday approximation.

Apr 15th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. import math
  2.  
  3. number_of_people = 23
  4.  
  5. days_in_year = 365
  6. if number_of_people > days_in_year:
  7.     print(1)
  8. else:
  9.     print(1 - math.exp(- number_of_people ** 2 / (2 * days_in_year)))
Advertisement
Add Comment
Please, Sign In to add comment