$25
This homework was designed for you to better view/visualize the effects of social distancing in this difficult period that we are going through.
There is a city of 5 million 445 thousand people (you can think of this as a list with 5,445,000 items). Currently no one in the city is infected with COVID’19. Then on Day 1 one person gets infected with COVID’19. COVID’19 is transmitted from a person to a person with these specific characteristics:
i) when two people interact if both of them are free of COVID’19 then neither of them gets infected ii) when two people interact if one of them has COVID’19 then the probability to infect the other person is 5%
iii) when a person gets infected then the person stays infected for a period that ranges from 14 day to 28 days (the probabilities are equal). During this period the infected person may infect other people with COVID’19. At the end of the infection period the person is clear of COVID’19 and can no longer infect anybody else and also that person cannot get infected again (s/he is immune)
iv) the people that a person interacts with are random (e.g. in Day 1 I interacted with only two people, their ID’s were 11,456 and 2,342,516 and these ID’s were randomly selected)
v) a person interacts with 0 to 10 people every day (the number of people someone interacts is random and the probabilities are equal)
a) No Social Distancing Case:
Based on the aforementioned data write a Python program that tries to simulate on how many days more than half of the population will be infected with COVID’19.
b) Social Distancing Case:
On Day 20 social distancing is enforced. In social distancing the number of people a person interacts with is still between 0 and 10 but the probabilities have changed:
Number of People that a person interacts
0
1
2
3
4
5
6
7
8
9
10
Probabilities
50%
25%
10%
5%
3%
2%
1%
1%
1%
1%
1%
Calculate how many people will be infected with COVID’19 on the same day that half of the population was infected in Part (a): No Social Distancing Case.
You are required to submit only the Python source code of your program, nothing more (I will test your program by executing it). You are required to use lists, you can use multiple lists or a two-dimensional list.