The birthday paradox says that the probability that two people in a room will have the same birthday is
more than half, provided n, the number of people in the room, is more than 23. This property is not really
a paradox, but many people find it surprising. Design a Python program that can test this paradox by a
series of experiments on randomly generated birthdays, which test this paradox for n = 5,10,15,20... 100.
Answers
Answer:
How many people must be there in a room to make the probability 100% that at-least two people in the room have same birthday?
Answer: 367 (since there are 366 possible birthdays, including February 29).
The above question was simple. Try the below question yourself.
How many people must be there in a room to make the probability 50% that at-least two people in the room have same birthday?
Answer: 23
The number is surprisingly very low. In fact, we need only 70 people to make the probability 99.9 %.
Let us discuss the generalized formula.
What is the probability that two persons among n have same birthday?
Let the probability that two people in a room with n have same birthday be P(same). P(Same) can be easily evaluated in terms of P(different) where P(different) is the probability that all of them have different birthday.
P(same) = 1 – P(different)
Explanation:
input a string "python ". write a program to print all the letters except' y'..please koi jaldi se sahi answer bta