Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


HW 6

Math 183

Fall 21


        Follow closely the ’Hw guide’ under Files in the folder ’Course Contents’ on how to write, scan and submit your hw.


        Details for full credit:

On any problem involving R, you should include your code and output as part of your answer. You may take a screenshot of the code/output, or write it by hand.

On any problem involving probability, remember to define any event that you decide to use to have full credit. For example, if at some point you write something like P(A) = 0.5, before that, you need to define what is A for you, such as ’Let A be the event that the first roll is even’. To be even more clear:

Acceptable: Let A be the event that the roll is even. Then P(A)=0.5.

Unacceptable: P(A) = 0.5 or P(even) = 0.5.

On any problem involving random variables, remember to define any random variable that you decide to use to have full credit. For example, if at some point you write something like E(X), before that, you need to define what is X for you, such as ’Let X be the number of exercises I have on a random week’. To be even more clear:

Acceptable: Let X be the number of exercises I have on a random week. Then E(X)=5.

Unacceptable: E(X) = 5 or E(exercises) = 5.

If you use one of the distribution learned in class, to give a complete picture, you need to specify all the parameters. For example, X ~ B(n, p) does not completely specify the distribution of X but X ~ B(10, .5) does.

Suppose a RV X follows a known distribution, such as X ~ B(10, .5) and you need to compute probabilities such as P(X ≤ 1). If the exercise states ’Compute your answer both by hands and using R’, it means that you should do both the following:

– P(X ≤ 1) = P(X = 0) + P(X = 1) = + = ..... ≈ 0.011

– In R ’pbinom(1,10,.05)’ gives me approximately 0.011

● Suppose a RV X follows a normal distribution, such as X ~ N(0, 0.5) and you need to compute probabilities such as P(X ≤ 1). If the exercise states ’Compute your answer using both the table and R.’, it means that you should do both the following:

– P(X ≤ 1) = P(Z ≤ ) = P(Z ≤ 2) = 1 − P(Z > 2) = 1 − P(Z < −2) = 1 − 0.0228 = 0.977 where you find the probability using the table. You do not need to attach the table.

– In R ’pnorm(1,0,0.5)’ gives me approximately 0.977

Similarly you need to do the same for the Student’s t distribution.

If nothing is specified, you are free to choose between the two methods.

● When you conduct an HT remember to lay down all the necessary steps shown in class:

– Define the parameter/s and the hypotheses.

– Name the test you intend to conduct.

– State and check the assumptions needed.

– Define the test statistic, its sampling distribution under the null and the value it takes in your sample.

– Compute the p-value.

– Make a conclusion. Beside saying if you reject or you fail to reject the null write a meaningful conclusion such as ’It seems that the proportion of people that dresses up for halloween is actually .80’.

● When you construct a CI remember to lay down all the necessary steps shown in class:

– Define the parameter/s of interest.

– Name the interval you intend to construct.

– State and check the assumptions needed.

– Compute the bounds of the CI.

– Write a concluding statement that helps people understand how to make sense of your interval.

● If you use a theorem, you should state the name of the theorem used.


1 Exercise 1

For each of the following statistic, indicate the exact distribution. If the exact distribution is unknown, indicate the approximate distribution. Remember to indicate the shape, the appropriate parameters and if the distribution is an exact distribution or an approximate one.


2 Exercise 2

You are curious to know what is the average number of sunlight hours per day in San Diego in November. Last year the average number of sunlight hours per day in the month of November had a sample mean of 10.50 hours and a sample standard deviation of 2.

a) Construct a 83% CI for the average number of sunlight hours per day in San Diego in November.

b) How does the confidence level in part a) have to change if we want a CI that is twice as wide? Assume other aspects of the problem remain the same.

c) You read an article that reports, for the average number of sunlight hours in November in San Diego the following 90% CI: [10,10.80]. The article says that they used a sample of 50 random November days with sample mean 10.40. Find the sample standard deviation of the data used to construct such CI. Here use the table and not R.

d) You are curious to know if on average in San Diego you get less sunlight hours per day in December with respect to November. You have access to a meteorological archive and over the course of the last 50 years you collect the number of sunlight hours of 100 random November days. You get a sample mean of 10.45 hours with a sample standard deviation of 2.5. You also collect the number of sunlight hours of 100 random December days. You get a sample mean of 10.10 hours with a sample standard deviation of 2.1. Use these results to conduct an HT with significance level 0.02. Compute your answer using both the table and R.

e) Are the two samples used in d) paired or independent? If they are paired write down a proposal on how to collect independent samples. If they are independent write down a proposal on how to collect paired samples.

f) Suppose now you want to construct a 98% CI for the true difference in the average number of sunlight hours between November and December using the data from part d). Could you use your result from part d) to say, without constructing the CI, if 0 is contained or not into the CI?

g) Construct a 98% CI for the true difference in the average number of sunlight hours between November and December using the data from part d).


3 Exercise 3

You decide to start fostering dogs for a non-profit rescue. You start documenting yourself and you learn that it could happen that, if the foster dog happens to be not a good fit in your home, you can reach out to the foster coordinator so that the dog can find a new home. This is called ’refostering’. You are curious to know if the refostering in California happens mostly when in the foster home there are already other pets. You collect some random data on 1000 foster cases in California, 600 of them in a house without any other pets while 400 in a house with already other pets. In the first case, 55 dogs needed refostering. In the second case, 50 dogs needed refostering. Your friend believes that the probability of refostering does not depend on if the house has already other pets, while you think that it might be higher if there are already other pets, since sometimes pets can be territorial in their home.

a) Find a 93% CI for the true difference in refostering proportion between foster home with no pets and foster home with other pets. Compute your answer using both the table and R.

b) Conduct an hypothesis test with a significance level of 0.05. Compute your answer using both the table and R.

c) Does the conclusion of b) prove what you have thought: there is an higher chance of refostering in house with already other pets because pets can be territorial in their home? If not, provide a different explanation of why that could be.

d) Assume now that you have lost the piece of paper where you wrote the data down and you don’t remember how many pet-free foster homes you had and how many foster homes with pets you had. You only remember that the foster homes in your sample were 1000 in total, that 55 dogs needed refostering in pet-free homes and that 50 dogs needed refostering in homes with other pets. Moreover you remember that you reject the null at the significance level of 0.1. What are all the possible numbers that the sample size of the pet-free foster homes can take? Use the table and not R. Set up your equation. Do not solve it.