diff --git a/Basic Codes/Birthday.java b/Basic Codes/Birthday.java new file mode 100644 index 0000000..ffc11d0 --- /dev/null +++ b/Basic Codes/Birthday.java @@ -0,0 +1,12 @@ +//Birthday Paradox problem +class HBD { + static double find(double p) { + return Math.ceil(Math.sqrt(2 * 365 * Math.log(1 / (1 - p)))); + } + + //Driver + public static void main(String[] args){ + + System.out.println(find(0.70)); + } +} \ No newline at end of file