Question: In python Problem 1: Birthday problem (5 points) How many people do we need to have in a room to make it a favorable bet
In python
Problem 1: Birthday problem (5 points) How many people do we need to have in a room to make it a favorable bet (probability of success greater than 1/2) that at least two people in the room will have the same birthday? Ignore leap year and assume that the probability of birthday falling on any of 365 days is equal. To answer the above question, please write a Python function "same_bday_prob(i)" in the cell below. The function takes an integer greater than 1 as input and returns the probability that at least two people have the same birthday. # If you wish, you may use the lambda function and the modules imported below from math import factorial from numpy import prod combin = lambda n, r : factorial(n)//factorial(r)//factorial(n-r) def same_bday_prob(i):
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
