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
#!/usr/bin/python3 | |
# This is used for calculating of birthday paradox for large values | |
# We're using approximation explained here: http://preshing.com/20110504/hash-collision-probabilities/ | |
# Beware that approximation isn't very precise at smaller params N and K, but gets more precise with large numbers | |
# see https://docs.python.org/3/library/decimal.html#module-decimal | |
from decimal import * | |
# setting decimal precision |