the variable ‘float p’ is denoting the probability of people having different birthdays rather than probability oif people having same birthday. Please clarify
Regarding Birthday Paradox
P refers to the probability of 2 people having birthdays on same date.
You can simply use the mathematical formula ceil(sqrt(1.02365*log(1/(1-p)))) to solve this.
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.