Answer:
import random
def calc_birthday_probability(num_people):
num_tries = 1e6
num_duplicates = 0
tries = 0
while tries < num_tries:
total_birthday = {}
for i in range(1, 366):
total_birthday[i] = 0
for count in range(num_people):
birthday = random.randint(1, 365)
if total_birthday[birthday] != 0:
num_duplicates += 1
break
total_birthday[birthday] += 1
tries += 1
return num_duplicates/num_tries
def main():
num_people = 10
p = calc_birthday_probability (num_people)
print(p)
num_people = 20
p = calc_birthday_probability (num_people)
print(p)
return
if __name__ == "__main__":
random.seed(2020)
main()
Explanation:
-
Run the loop until the value of tries is less than num_tries to do number of trials.
- Run the loop to create the desired number of birthdays by generating random numbers.
- Increase the num_duplicates variable by 1, if the birthday has already occurred.
- Lastly define and then call the main function.
Answer:
False. Never reach across a load when you're trying to lift it.
I will but i have to wait till after 3;00 will you still be online by then. If not you can just friend me and message me when you are today
Answer:
I. Improper cable installation.
II. Interference between the signals on cables close to each other.
III. Improper connection of a network cable to the jack
Explanation:
The standard framework for the transmission of informations on the internet, it is known as the internet protocol suite or Transmission Control Protocol and Internet Protocol (TCP/IP) model. Thus, the standard Internet communications protocols which allow digital computers to transfer (prepare and forward) data over long distances is the TCP/IP suite.
In this scenario, Mark is unable to connect to the internet or to any of the computers on his network, while nearby computers don’t have this problem. Therefore, the three issues which could be causing the problem are;
I. Improper cable installation: this involves not installing the ethernet cable in the correct destination port.
II. Interference between the signals on cables close to each other: interference usually results in the disruption in network signals.
III. Improper connection of a network cable to the jack: the right connectors such as RJ45 should be used.