Birthday Paradox | C ++ program to approximate number of people in Birthday Paradox problem ; Returns approximate number of people for a given probability ; Driver code
#include <cmath> NEW_LINE #include <iostream> NEW_LINE using namespace std ; int find ( double p ) { return ceil ( sqrt ( 2 * 365 * log ( 1 / ( 1 - p ) ) ) ) ; } int main ( ) { cout << find ( 0.70 ) ; }