Last active
April 7, 2021 00:36
-
-
Save fabiom/2d2b73be023beb81fa7e9d5f95bc90aa to your computer and use it in GitHub Desktop.
Returns the probability of two people out of n having the same birthday.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BirthdayParadox(n) | |
# Returns the probability of two people out of n having the same birthday. | |
1-prod( ((365-n+1):365.0) /365.0 ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment