Birthday paradox

test case 6 is not cleared.
I have used the approximate formula for the birthday paradox which can be derived using taylor series.
why that formula is invalid in this case?

Please share your code by saving it online on the IDE

here is the link.

1 Like

Your code looks good for every condition which lacks one end condition. Please try that end condition where p hits it’s end point on your own.

If you still have any other doubts, feel free to ask again.

Thank you sir.
Code is submitted:)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Sir plz explain this formula
people = ceil(sqrt(2*365*log(1/(1-p))))
why this is not working
mycode

in both the solution there are same result.
test case 5 is not passed.
plz explain why

I think you should read the question again and dry run you code again according to the question, you will be able to see the mistake.
Please for the next time post your doubt separately so that we can work on your problem personally and help you better.

1 Like