## STM4PSD Assignment Help

## ASSIGNMENT 3 Assignment help

Question 1. (5 marks) An electronics store has a repair department with one staff member working each day. The

repair department is open every day starting from 9AM, and closes 6 hours later at 3PM. Customers bring devices

to the store according to a Poisson process, with an average number of 5.5 devices arriving per 6-hour working day.

The time to repair a device is exponentially distributed, with an average completion time of 50 minutes. As soon

as a repair is completed, the customer can collect their device from the store. Assume that the staff member works

continuously throughout the day, and then continues any unfinished jobs at the start of the next working day.

Given these assumptions, the number of devices in the store can be modelled as an M/M/1 queue. Assume that the

queue has been running for long enough that its steady state properties apply.

(a) Write down the arrival rate, service rate, and the traffic intensity for this queue. Include relevant units.

(b) On a given day, what is the probability that 2 or fewer customers bring a device to the store before noon?

(c) Once the staff member begins repairing a device, what is the probability that it takes 1 hour or less to repair

that device?

(d) What is the average number of devices in the queue (including any which are currently being repaired)?

(e) The store tells customers that they can expect to be able to collect their device by the next working day. Is the

store’s claim justified? Explain.

(f) On average, how much time in one 6-hour work day will the staff member be actively repairing devices?

Complete Question 1 by hand, showing all working. Round your answers to at least 2 decimal places.

Question 2. (5 marks) The diagram below depicts a queue which has a maximum capacity of 4, an arrival rate λ,

and can process two individuals at once, each with a service rate μ.

0 1 2 3 4

λ λ λ λ

μ 2μ 2μ 2μ

Assume that the queue is in a steady state, let N denote the number of individuals in the queue, and let Pi denote

the probability that the queue is in state i, so that Pi = P(N = i).

Using “flow in equals flow out” methods like in Question 4 of Lab 6, complete the following.

(a) Find expressions for P1, P2, P3 and P4 in terms of the traffic intensity ρ = λ

μ and P0.

(b) Hence determine P0 in terms of ρ only.

(c) Complete the remaining entries in the probability mass function table for N:

1 of 3

i 0 1 2 3 4

P(N = i) 2ρ3

8+8ρ+4ρ2+2ρ3+ρ4

ρ4

8+8ρ+4ρ2+2ρ3+ρ4

Give each entry in terms of ρ only.

(d) Determine an expression for L, the long-term average number of individuals in the system, in terms of ρ only.

Hint: how do you usually compute an average from a probability mass function table?

Complete Question 2 by hand, showing all working. For part (a), you must clearly state the flow in and flow out that

you use.

Question 3. (4 marks) Consider the sample below, which has been sampled from a normal distribution.

14.6, 15, 13.2, 15.5, 13.3, 8.8, 9.3, 10.9

Let n denote the sample size, let ˆμ denote the sample mean, let SE denote the standard error, and let μ denote the

true population mean. Suppose you were testing the hypothesis

H0 : μ = 14 versus H1 : μ ̸= 14.

Assume a 5% level of significance.

(a) State the value of n, and determine ˆμ and SE.

(b) Using a t-distribution, calculate a 95% confidence interval for μ. Use R to find the appropriate value of tn−1,p.

(c) Based on your answer to (b), state an appropriate conclusion, with justification.

(d) Calculate the test statistic needed to perform a t-test for the hypotheses above.

(e) Use R to calculate the p-value for the t-test. You must clearly indicate the probability distribution(s) used.

(f) Based on your answer to (e), state an appropriate conclusion, with justification.

Complete Question 3 by hand, except where it is stated that R can be used. Show all working. Give all answers to at

least 3 decimal places.

Question 4. (6 marks) For this question, you will be using a CSV file with the filename bikes.csv. The CSV

file contains 110 entries recording the number of users of the Capital Bikeshare bicycle-sharing system based in

Washington D.C., USA, with 60 samples from the year 2011 and 50 from the year 2012. Each row includes the year,

month and date of the record, and various weather features, as well as the number of casual users and the number of

registered users on that day. For example, the first row of the data is:

year month date temp humidity windspeed casual registered

2011 1 8 0 54 18 68 891

This says that on January 8, 2011, the average temperature was 0◦C, the humidity was 54%, the windspeed was

18km/h, and there were 68 casual users and 891 registered users of the bicycles on that day.

(a) The number of casual users in each day is recorded in the casual column. Use R to compute an estimate for the

mean number of casual bicycle users per day, and then compute a 95% confidence interval for the mean number

of casual bicycle users per day. Give a brief summary of your answer that could be understood by someone with

no background in statistics.

(b) The number of registered users in each day is recorded in the registered column. Use R to compute an estimate

for the mean number of registered bicycle users per day, and then compute a 95% confidence interval for the

mean number of registered bicycle users per day. Give a brief summary of your answer that could be understood

by someone with no background in statistics.

In the remaining parts of this question, you will need to extract relevant rows from the data frame to address specific

questions. In the following description, it is assumed that you have imported the dataset into a variable called bikes.

Assuming the data frame is stored in a variable called bikes, you can create additional data frames by requesting

only the rows meeting certain conditions. For example, to create a data frame called bikes.2011 that contains only

the records from the year 2011, you can use the following syntax:

bikes .2011 <- bikes [ bikes$year == 2011 , ]

Note that the comma at the end is essential (as it indicates that all columns should be taken).

You can use the nrow function to count the number of rows in a data frame. If you have done this successfully, then

typing nrow(bikes.2011) should show that there are 60 records from the year 2011.

(c) Use R to compute a 95% confidence interval for the mean total number of bicycle users (casual plus registered)

per day in the year 2011. Give a brief summary of your answer that could be understood by someone with no

background in statistics.

You will need to sum together the casual and registered users for each day before computing the interval. Remember

that addition in R acts on vectors, and data frame columns are vectors.

(d) Use R to compute a 95% confidence interval for the mean total number of bicycle users (casual plus registered)

per day for days where the average temperature is 10◦C or more. Give a brief summary of your answer that

could be understood by someone with no background in statistics.

For Question 4, include in your submission the code you use and any estimates and intervals you obtained, to the

nearest whole number. Your code must be neatly written (preferably typed), following the instructions above.

The only functions you may use are those described in the question and the built-in R functions that have been studied

in the labs. For the confidence intervals, you must use the form that depends on the t-distribution.

## Leave A Comment