Question

Question 1. 50 points Here we want to model the spread of the COVID-19 epidemic! Assume...

Question 1. 50 points
Here we want to model the spread of the COVID-19 epidemic!
Assume that ENCE112 Country get it first infection from a gentleman who flew in from China-Town, Wuham. Assume also that each without isolation, any covid-19 patient infects one other person. If we assume that each covid-19 infected person is isolated after just one day.
a. Derive a recursive formula for the number of infected persons in n-days. 10 points
b. Develop a recursive algorithm for the formula you derived in “a.” above. 15 points
c. Translate the algorithm in “b.” above into C programming language and run it. 5 points
d. Generate the results of the first ten (10) days in a table of two columns, the first column holds the days and the second column holds the number of infected persons. 10 points
e. What will happy if each covid-19 patient infects more than one person per day before isolation? Repeat “d.” if the infection rate is two (2) instead of one. 10 points
Question 2. 50 points
We want to solve this program analytically and plot it and compare it to the discrete solution
above in Question 1.
Here we model the problem as a deferential equation. So the rate of infection is a function of the number of infected persons:
???? =??????????????????????? ??? ? ?? ?h? ???? ?? ?????????? ?? ????
Then we say that
dx = ??, where ? is constant signalling the number persons infected by each patient dt
a. Solve this equation with initial conditions of ? = 1 when ? = 0 10 points
b. For the case of ? = 1 write a simple C- program to compute the number of infections
for each day and generate a similar table as in Question 1 (d.) above. 10 points
c. Write a simple C-program to plot the points of the table with the days on the vertical
axis and the number of infections on the horizontal axis using “*”. Note: (0,0) is the upper left corner of the plot window! 30 points
0 0
Add a comment Improve this question Transcribed image text
Answer #1

model for COVID-19 epidemic
given that any covid-19 patients infects one other person
that is fist infect to -> second -> third so on.
also given that covid-19 infected person is isolated after just one day.
that is first person can not infect more then one person.
so our recursive formula is that
f(n) = f(n-1) + 1 where f(1) =1 and n is after number.
simple game of triangle
c Program for the child triangle game.
Program file is 'triangle.c'
#include <stdio.h>

// find the maximum stick
int maxStick(int *a,int *b,int *c){
// check c is maximum
if(*c>=*b && *c>=*a){
// swap max to a stick
int temp =*c;
*c=*a;
*a=temp;
}
//check b is maximum
else if(*b>=*a && *b>=*c){
int temp =*b;
*b=*a;
*a=temp;
}
return *a;
}

// determine form a triangle from stick
int formTriangle(int a,int b,int c){
// single test to check
// c programming not support boolean so use 0 and 1 for indication
if(b+c > a)
return 1;
else
return 0;
}

// determine angle
void checkAngle(int a,int b,int c){
// because it triangle form and sum of all angle is pi(180)
printf("all the three angle of triangle are < pi\n");

// check for one angle >pi/2
if(a*a > b*b +c*c)
printf("One angle > pi/2\n");
// check for one angle = pi/2
else if(a*a == b*b +c*c)
printf("One angle = pi/2\n");
}

int main(){
printf("Enter the length of three stick :");
int a,b,c;
scanf("%d%d%d",&a,&b,&c);

// call function to find max stick
printf("Largest stick is %d\n",maxStick(&a,&b,&c));
  
if(formTriangle(a,b,c)){
printf("True\n");
checkAngle(a,b,c);
}
else
printf("False\n");

return 0;
}

Add a comment
Know the answer?
Add Answer to:
Question 1. 50 points Here we want to model the spread of the COVID-19 epidemic! Assume...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 3: (1 mark for each part) The percentage of coronavirus (COVID-19) infected people in a...

    Question 3: (1 mark for each part) The percentage of coronavirus (COVID-19) infected people in a certain city is 15%. Suppose that we randomly select a sample of 6 people from this city. a) Find the probability that there will be one infected person in the sample. b) Find the expected number of infected people in the sample (E(X) = ?). c) Find the variance of the number of infected people in the sample (? 2 )

  • Unable to correct errors from my MatLab Script and would like to see a script to...

    Unable to correct errors from my MatLab Script and would like to see a script to compare mine to. Write a MatLab script that simulates a virus spread. This problem needs the following parts, some of which are nested loops, ie Part 3, 4 and 5 are nested in Part 2’s loop (for or while): To build the program first to only deal with infection transmission within the town’s neighbors An array which for every person in the town which...

  • Critical Thinking Questions: 5 points (1 point each) Chapter 19 When and how does our immune...

    Critical Thinking Questions: 5 points (1 point each) Chapter 19 When and how does our immune system discriminate between self and nonself antigens? Do people with AIDS make antibodies? If so, why are they said to have an immunodeficiency? Chapter 20 Which of the following can affect human cells? Explain why. penicillin indinavir erythromycin Polymyxin Chapter 21 Is it necessary to treat a patient for warts? Explain briefly. A laboratory test used to determine the identity of Staphylococcus aureus is...

  • Part A - SIR model for the spread of disease Overview. This part of the assignment...

    Part A - SIR model for the spread of disease Overview. This part of the assignment uses a mix of theory and data to estimate the contact number c=b/k of an epidemic and hence to estimate the infection-spreading parameter b. The point is that once you know the value of b for a certain disease and population, you can use it in your model the next time there is an cpidemic, thus cnabling you to make predictions about the demand...

  • Question 19 (2 points) (19-20) The Johnson Company produces a lift truck. A metal rod is...

    Question 19 (2 points) (19-20) The Johnson Company produces a lift truck. A metal rod is one of the most important components. To check its quality, five samples were taken during four successive days and then the length of each unit was measured. The results are in the following table. Table for factors for control limits is also given. The company needs to determine whether the process is stable using process mean chart and process variation chart. Sample 1 Sample...

  • Question 1 If we need to have a frequency resolution of 50 Hz or better and a time resolution of 10 microsecond or better, and we want the number of data points to be a power of 2, what is the minimu...

    Question 1 If we need to have a frequency resolution of 50 Hz or better and a time resolution of 10 microsecond or better, and we want the number of data points to be a power of 2, what is the minimum number of data points necessary for a Discrete Fourier Transform of a signal? What is the resulting sampling and Nyquist frequency? (9 pts) If we need to have a frequency resolution of 50 Hz or better and a...

  • R CODE PROGRAM 1. Suppose we want to simulate an experiment that can take outcomes 1;...

    R CODE PROGRAM 1. Suppose we want to simulate an experiment that can take outcomes 1; : : : ; n with probabilies p1; : : : ; pn. To be specic, suppose the R-vector p=c(.1,.2,.3,.35, .02, .03) gives the desired probabilities. Write R code that produces a number from 1 to 6 with the given probabilities, without using if statements. I recommend using the R command cumsum to do this, though there many possible approaches. 2. Suppose we are...

  • Hi, I need help please! What method of research can we assume Salk and Sabin used...

    Hi, I need help please! What method of research can we assume Salk and Sabin used to acquire their vaccines? (Points : 4)        Socratic Method        Illustrative Method        Visual Method        Philosophical Method        Scientific Method (TCO 9) Cat fecal matter is one possible source for getting infected with _____, which invades the _____ system of humans. (Points : 4)        Chagas’ disease; circulatory        African sleeping sickness; nervous        Western sleeping sickness; circulatory        toxoplasmosis; lymph       ...

  • QUESTION 1 Which of the following is the primary function of red blood cells? A. Fight...

    QUESTION 1 Which of the following is the primary function of red blood cells? A. Fight infection B. Oxygen Transport C. Aid in coagulation D. Participate in inflammatory reactions 1 points    QUESTION 2 Malaria can be a serious illness because of which of the following? A. It causes premature red blood cell break down B. It infects and destroys lymphocytes C. It causes a decrease in the production of red blood cells D. It causes a vitamin B12 deficiency...

  • QUESTION THREE The weekly Hotel bill (HB) per traveller for COVID-19 mandatory quarantine accommodation and centres...

    QUESTION THREE The weekly Hotel bill (HB) per traveller for COVID-19 mandatory quarantine accommodation and centres are in high demand in Accra due to the limited accommodation facilities for these persons. Government may withdraw from taking care of the costs as expert say that the COVID- 19 has come to stay with us similar to other diseases. For this reason, it has become imperative for travellers to carefully plan for their accommodation. Information has been gathered to help travellers predict...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT