Question

Please provide the code in the language R. (请提供语言R的代码) Suppose the incubation period, T , of...

Please provide the code in the language R. (请提供语言R的代码)

Suppose the incubation period, T , of a certain disease can be modeled by an exponential distribution with a mean of 4.5 days

1. Run a simulation to estimate the probability that, among 100 people who have contracted the disease, 80 or more people will develop symptoms within 5 days.

2. Suppose the number of new cases contracting the disease today follows a Poisson distribution with a mean of 100 people. Modify your simulation in (1) to estimate the probability that, among people who have contracted the disease today, 80 or more people will show symptoms within 5 days.

3. Generate a histogram of the distribution of the number of people that will show symptoms within 5 days, under the setup in (2).

Homework Answers

Answer #1

1.

R code:

n=100000
a=0
count=0


for(k in 1:n)
{
   for(i in 1:100)
   {
       x=rexp(100,(1/4.5))
       if(x[i]<5)a=a+1
   }
   if(a>80)count=count+1
   a=0
}

cat("The required probability is ",count/n)

Result:

[1] The required probability is 0.00151

2.

R code:

n=100000
a=0
count=0


x=rpois(n,100)
y=rexp(n,1/4.5)
for(i in 1:n)
{

   if(x[i]>80 && y[i]<5 ) count=count+1

}

cat("The required probability is",count/n,"\n")

Result:

The required probability is 0.65526

3.

R code:

n=10000
k=1
z=c()


x=rpois(n,100)
y=rexp(n,1/4.5)
for(i in 1:n)
{

   if(y[i]<5)
   {
       z[k]=x[i]
       k=k+1
   }

}

hist(z)
Graph:

Know the answer?
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
Similar Questions
Please show all work and provide legible responces. Suppose that a 2000 Census showed that 33%...
Please show all work and provide legible responces. Suppose that a 2000 Census showed that 33% of all adults own more than one vehicle.  You will be surveying 79 individuals and are curious about the current proportion of people who own more than one vehicle.  Answer the following questions Prove that this situation can be modeled using a normal distribution.  In other words, verify the conditions for p-hat being normally distributed.  Then state the mean and st dev of p-hat. What is the probability...
R Code Directions: All work has to be your own, you may not work in groups....
R Code Directions: All work has to be your own, you may not work in groups. Show all work. Submit your solutions in a pdf document on Moodle. Include your R code (which must be commented and properly indented) in the pdf file. Name this pdf file ‘your last name’-HW5.pdf. Also submit one text file with your R code, which must be commented and properly indented. You may only use ‘runif’ to generate random numbers; other random number generating functions...
Problem 4) In 2012, the percent of American adults who owned cell phones and used their...
Problem 4) In 2012, the percent of American adults who owned cell phones and used their cell phone to send or receive text messages was at an all-time high of 80%. Assume that 80% refers to the population parameter π. More recently in 2016, a polling firm contacts a simple random sample of 110 people chosen from the population of cell phone owners. The firm asks each person “do you use your cell phone to send or receive texts? Yes...
In the following problem, check that it is appropriate to use the normal approximation to the...
In the following problem, check that it is appropriate to use the normal approximation to the binomial. Then use the normal distribution to estimate the requested probabilities. Ocean fishing for billfish is very popular in the Cozumel region of Mexico. In the Cozumel region about 41% of strikes (while trolling) resulted in a catch. Suppose that on a given day a fleet of fishing boats got a total of 26 strikes. Find the following probabilities. (Round your answers to four...
(15%) For Applied Management Statistics class you want to know how college students feel about the...
(15%) For Applied Management Statistics class you want to know how college students feel about the transportation system in Barcelona. What is the population in this study? What type of sample would you use and why? (25%) A manager of an e-commerce company would like to determine average delivery time of the products. A sample of 25 customers is taken. The average delivery time in the sample was four days. Suppose the delivery times are normally distributed with a standard...
Please review the following below and provide , one-page reaction to this budget proposal. 1. Budget...
Please review the following below and provide , one-page reaction to this budget proposal. 1. Budget The President’s Budget and Health Care While the president’s budget is not likely to be acted upon by Congress, it does signal what the administration’s priorities are—as well as what policy initiatives they might push. Repeal the Affordable Care Act: The administration’s budget includes a plan that is based upon the plan put forward by Sens. Lindsey Graham (R-SC) and Bill Cassidy (R-LA) last...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Read the following case carefully and then answer the questions. In the movie Face/Off, John Travolta...
Read the following case carefully and then answer the questions. In the movie Face/Off, John Travolta got a new look by exchanging faces with Nicolas Cage. Unfortunately, he got a lot of trouble along with it. John could receive a much less troublesome new look by using Botox, a treatment discovered by Vancouver’s Dr. Jean Carruthers, who came upon the cosmetic potential of Botox in 1982 while treating a woman with eye spasms. Botox is marketed by Allergan, a specialty...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...