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


HW 4

Math 183


        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 ≤ 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


1   Exercise 1

Once in a while you try to set up a challenge for yourself and you try to not eat sugar-loaded snacks and desserts. The time, in days, until you break your promise is well modeled by an exponential distribution with λ = 0.3.

a) What is the probability you last at least 1 week before quitting? Compute your answer both by hands and using R.

b) What is the probability you last exactly 2 weeks before quitting?

c) ’90% of the time I challenge myself to not eat sugar-loaded snacks and desserts, I quit within x days’. Find the right x. Compute your answer both by hands and using R.

d) Perform simulations in R to approximate your answer of part a).


2   Exercise 2

Every Monday morning you are going to your favorite workout class. Assume that the duration of the class, in minutes, is normally distributed with mean 60 and standard deviation 4. Right after the workout class you need to quickly shower and run to your math class. You have noticed that, when the workout class lasts more than 64 minutes, you will be late for your math class.

a) What is the probability that, on a random Monday, you are late for your math class? Compute your answer using both the table and R.

b) ’10% of the time the class will last more than x minutes.’ Find the right x. Compute your answer using both the table and R.

c) In a quarter (10 weeks of class), in how many weeks do you expect to be late for your Monday math class?

d) In a quarter (10 weeks of class), what is the probability that you will be late for your Monday math class at most 1 time?

e) The professor will get annoyed with you the 3rd time you are late. After how many weeks do you expect the professor to get annoyed with you?

f) On the other hand, you have noticed that, when your workout class lasts less than 55 minutes, you are able to get to your math class early enough to get good seats for both you and your friend. What is the probability that you are able to get good seats in your Monday math class for you and your friend for the first time during week 5? Compute your answer both using table and using R.


3   Exercise 3

The length of students’ homework solutions, in pages, for this class is normally distributed with mean 9 and standard deviation σ.

a) If I tell you ’your solution was among the shortest 20% solutions if you wrote less than 5 pages”, find σ. Here don’t use R to just guess and check but use the normal table.

b) Based on your choice in part a, in which ranges your solutions’ length should be if you want to be in the central 60% of the possible lengths? Compute your answer using both the table and R.

c) By the end of the quarter you will turn in 8 homework solutions. Assume that the homework solutions’ lengths are independent with each other. Find the exact distribution of the total length of the 8 homework solutions. (Find the shape and the parameters that define it).

d) Verify part c in R: simulate 1000 times the experiments (choose 8 hw solutions at random and sum their lengths) and collect the 1000 total lengths. To check the shape of the distribution plot the histogram of the 1000 total lengths. Moreover check also the parameters of the distributions.

e) The length of students’ homework solutions, in pages, for your computer science class is normally distributed with mean 8 and standard deviation 0.5. It is moreover independent of this class homework solutions’ length. What is the probability that a random homework solution for this class is longer than a random homework solution for your computer science class? Compute your answer using both the table and R.


4   Exercise 4

You’ve taken a job as educational researcher and want to model how long it takes into the school year (in week), before a student reports feeling exhausted. Based on other research, you learn this is well modeled by an exponential distribution with parameter 0.5. Let Y be the average exhaustion time of 500 random students.

a) What is the approximate distribution of Y and what are its parameters?

b) Verify that in R: simulate 1000 times the experiments (choose 500 students at random and average their exhaustion times) and collect the 1000 averages. To check the shape of the distribution plot into an histogram the 1000 averages. Moreover check also the parameters of the distributions.

c) You want to write in a journal ’90 % of students feel still fine at week x’. What x you should use? Compute your answer both by hand and using R.

d) You want to write in a journal ’It is very likely (.95 of probability) that the average exhaustion time of 500 random students is less than x weeks’. What x you should use? Compute your answer using both the table and R.