text: public static int GetEstimatedNumberUniqueValuesAllowingForCollisions(int setSize, int numRecordedBits){double setSizeAsDouble = setSize;double numRecordedBitsAsDouble = numRecordedBits;var saturation = numRecordedBitsAsDouble/setSizeAsDouble;var logInverseSaturation = Math.Log(1 - saturation)*-1;return (int) (setSizeAsDouble*logInverseSaturation);}