1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Free_Kalibri [48]
3 years ago
12

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 t

he 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
Computers and Technology
1 answer:
Vladimir [108]3 years ago
5 0

Answer:

He had a nearly 71% chance that 2 or more of us would share a birthday.

Explanation:

You might be interested in
When malicious code is planted on your computer and alters your browser's ability to find web addresses, it is known as ________
tresset_1 [31]
The answer is Phishing
3 0
3 years ago
Read 2 more answers
Sending a busy manager a long email represents a problem in which area of the communication process
FromTheMoon [43]
Time management,they wouldn’t have enough time to read it and they would become more stressed out
3 0
3 years ago
Which feature of a blog helps to store and retrieve older posts?
Rashid [163]
Could it be archive posts? I'm not sure, but I believe it's archive posts.
8 0
3 years ago
Read 2 more answers
In what year was the earliest documented use of the word computer?.
topjm [15]

Answer:

1946

First, to deal with the more recent and most familiar meaning of the word ‘computer’: the word first came to mean an electronic device used to store and communicate information (and all of its subsequent functions) only in the 1940s: the earliest citation in the Oxford English Dictionary is from 1946. This is fitting.

Explanation:

7 0
2 years ago
Most V-type engines use two _______, one attached to each cylinder head.
wlad13 [49]
The correct answer is letter c. exhaust manifolds. Most V-type engines use two exhaust manifolds, one attached to each cylinder head. An exhaust manifold in automative engineering refers to the collection of the exhaust gases from different cylinders into another single pipe.
7 0
3 years ago
Other questions:
  • The weird suspicious box that k12 sends the parents to put on the router. im getting strange privacy error messages on google an
    8·1 answer
  • Change control in application development is a formal process for changing written documentation into online documentation, and
    13·1 answer
  • A user reports that she can't access the new server used in the accounting department. you check the problem and find out that h
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·1 answer
  • To rename a database object, press and hold or right-click the object in the navigation pane and then tap or click ____ on the s
    10·1 answer
  • Write java code that displays all the objects in a stack in the order in which they were pushed onto it. after all the objects a
    5·1 answer
  • How much does a dodge tomohawk cost for a used one?
    7·1 answer
  • Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show th
    13·1 answer
  • Types of Hazards Mitigation Measures
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!