Computers and Technology, 17.03.2020 05:44 YariDelOrbeez115
The birthday problem is as follows: given a group of n people in a room, what is the probability that two or more of them have the same birthday? It is possible to determine the answer to this question via simulation. Using the starting template provided to you, complete the function called calc birthday probability that takes as input n and returns the probability that two or more of the n people will have the same birthday. To do this, the function should create a list of size n and generate n birthdays in the range 1 to 365 randomly, inclusive of the end-points 1 and 365. It should then check to see if any of the n birthdays are identical. The function should perform this experiment 106 times and calculate the fraction of time during which two or more people had the same birthday. The function will be called as follows from your main program:
IN PYTHON PLEASE
import random
def calc_birthday_probability (num_people):
random. seed (2020) # Don't change this value
num_trials = 1000
probability = 0
""" FIXME: Complete this function to return the probability of two or more people in the room having the same birthday. """
return probability
Answers: 1
Computers and Technology, 22.06.2019 08:00, dramaqueenactr2040
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
Computers and Technology, 23.06.2019 17:00, kyleemarie2003
Companies that implement and apply an information system effectively can create
Answers: 1
Computers and Technology, 23.06.2019 22:30, delawdermia27
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
Answers: 1
The birthday problem is as follows: given a group of n people in a room, what is the probability tha...
Mathematics, 05.05.2020 23:24
Mathematics, 05.05.2020 23:24
History, 05.05.2020 23:24
History, 05.05.2020 23:24
Spanish, 05.05.2020 23:24