```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Introduction





* This assessment is classified as *Coursework* as defined in the UCL Student [Regulations](https://www.ucl.ac.uk/academic-manual/sites/academic_manual/files/chapter_4_student_regulations_for_exams_and_assessments_2024-25_v.2.pdf) for Exams and Assessments. 
 
* This ICA is worth 30 percent of your grade for this module.

* The release date is 13 December 2024.

*  This ICA is due UCL Week 24,  7 February 2025, 13:00 London Time.

* Individual extensions to the submission deadline can only be granted where a student has been issued with a Summary of Reasonable Adjustments ([SoRA](https://www.ucl.ac.uk/students/support-and-wellbeing-services/disability-support/reasonable-adjustments-your-assessments)), has used a [Delayed Assessment Permit](https://www.ucl.ac.uk/academic-manual/chapters/chapter-2-student-support-framework/section-2-delayed-assessment-scheme) (if the assessment is eligible), or has made a valid claim for [Extenuating Circumstances](https://www.ucl.ac.uk/academic-manual/chapters/chapter-2-student-support-framework/section-3-short-term-illness-and-other-extenuating). The standard extension length for this assessment type is 10 working days.
  * If you have an extension, it may *not* be reflected in Moodle.
  * Delayed Assessment Permits and Extenuating Circumstances claims should be submitted through Portico. The module lead will be notified and will act on extensions approved via these routes, but the deadline displayed in the submission portal may *not* update.

* You must only submit your work via the designated portal in Moodle. If you try to submit via email or any other channel this will not count as a submission and will not be marked.
* There are strict, non-negotiable [penalties](https://www.ucl.ac.uk/academic-manual/chapters/chapter-4-assessment-framework-taught-programmes/section-3-module-assessment#3.11) for late submission, which for coursework are as follows.
  * Up to 2 working days late: deduction of 10 percentage points, but no lower than the pass mark.
  *	2-5 working days late: capped at the pass mark.
  * More than 5 working days late: mark of 1.00%.

* If the module lead becomes aware of a significant technical issue or outage affecting Moodle during the assessment, a message will be circulated to explain what has happened and the steps being taken to mitigate the issue. If you do not receive notification of a more widespread issue and you experience technical difficulties, you should refer to the [Help & Support](https://www.ucl.ac.uk/isd/help-support) resources provided by UCL’s central IT service. However, last-minute technical issues will not be considered as valid grounds for missing the deadline, so ensure that you leave plenty of time to prepare, upload and check your submission.
* Non-submission (in the absence of any valid Extenuating Circumstances) will mean that your mark for this component is recorded as 0.00% and you will be deemed to have made an attempt.

* You should expect to receive feedback on this assessment within 20 working days of the submission deadline. In the event of a delay, the module lead will contact students directly with details of the revised timeline.
*	© (2024)  UCL. This assessment paper is the intellectual property of UCL and subject to copyright. It must not be reproduced or shared with any third party without prior permission of UCL.

<hr>

*  This ICA is to be completed in a group of 2-4; each member of the group will receive the same grade.
*  Your group-mates must be disjoint from that of ICA2, so that if Sam is in your ICA2 group, they can not be in your ICA3 group. 
* To facilitate anonymous marking, you should not write your name anywhere on your work, including in file names or file descriptions requested as part of the submission process.


* This ICA consists of 5 questions, worth 65 points;
  * another 5 points will be given based on presentation, so that the total available points is 70.

* The ICA must be completed in R/Quarto/Python and typeset using Markdown with Latex code, just like the way our module content is generated.
* Please hand in the html (or pdf file) **and** the Rmd/Jupyter notebook source files for your written report.
* As usual, part of the grading will depend on the clarity and presentation of your project.
*  You are to do this assignment, within your groups, without any help from others who are not in your ICA3 group.
*  You are allowed to use any materials and code that was presented so far.
*  Inline with our usual class policy and how I have presented module material, do not use any fancy code or packages imported from elsewhere.  In particular, if the main work/point of your project is the demonstrate branching processes, do not import or use a branching process package.

* Do not search the internet for answers to the ICA.



* The use of ChatGPT and related tools is **not** permitted.
 
* Conduct yourselves honorably.




* In preparation for this assessment, please ensure that you are familiar with the Department of Statistical Science’s guidance on academic integrity. When submitting your work, you will be required to make a declaration that you have read and understood this guidance.


#  Plagiarism and collusion

**As this is a group project, collusion and academic misconduct cases will apply to all members in the group. All group members bear full responsibility. If a student suspects any potential misconduct cases from other groupmates, they should inform [me](https://www.ucl.ac.uk/statistics/people/dr-terry-soo) immediately.**

Please familarize yourself with [the following guidance on academic integrity](https://www.ucl.ac.uk/statistics/sites/statistics/files/shbpc.pdf)

In addition please note that parts of your submission may be scanned using similarity detection software. If any breach of the assessment regulations is suspected, it will be investigated in accordance with UCL’s Student [Academic Misconduct Procedure](https://www.ucl.ac.uk/academic-manual/chapters/chapter-6-student-casework-framework/section-9-student-academic-misconduct-procedure).





By ticking the submission declaration box in Moodle you are agreeing to the following declaration:

<br>

**Declaration:** I am aware of the UCL Statistical Science Department's regulations on plagiarism for assessed coursework. I have read the guidelines in the student handbook and understand what constitutes plagiarism.  I hereby affirm that the work we are submitting for this in-course assessment is entirely our own.  




# Anonymous Marking 

Please do **not** write your names anywhere on the submission. Please include only your **student numbers** as a proxy identifier.


<hr>

# Problems


## Question 1  [20 points]

Consider $n=120$ independent $M/M/1$  queues.  Items arrive to each queue at rate $\lambda = 5$.  Each queue has a server who serves items at possible different rates $\mu_1, \ldots, \mu_{120}$.  The rate of the server is given by a linear model, 

$$\mu_i= mx_i + b + \epsilon_i,$$

where $\epsilon_i$ are iid normal noise variables with mean zero  and $x_i$ are the initial appraisals of the servers, given by a real number in $[5,10]$.  The appraisals are given by a text file [here](https://tsoo-math.github.io/ucl5/eval.txt).  We also have daily $k=50$ inspections, where we record the number of items in each queue.  These numbers are given by a text file [here](https://tsoo-math.github.io/ucl5/number.txt). 

* Find reasonable estimators for $m$ and $b$.  Explain and justify how you arrive at your estimates and state any assumptions that are necessary for your inference. [10 points] 
  * Apply your method on a data set that you generated, so that you know that it works.  [5 points] 
  * Apply your method on the given data set to find $m$ and $b$. [5 points]





## Question 2 [15 points]


Consider the renewal process $N$ with inter-arrival times that are independent and uniform over $[0.5, 1.5]$.   For all  integers $k$ consider the following limit:

$$\lim_{t \to \infty}\mathbb{P}[N(t+1) - N(t)=k].$$

* For what values of $k$ is limit non-zero. [2 points] 
* Use simulations to estimate these probabilities. [3 points]
* Compute the limit, analytically, pen and paper style. [10 points]




## Question 3 [10 points]

Consider the following scenario.  You know from your running apps that you can run $1$ mile pretty reliably, meaning $99$ percent of the time, you can run a mile between $9$ and $10$ minutes.  A $M(5)/M(5.1)/1$ queue is $1$ mile away--here it is a rate of $5$ customers per minutes.    Estimate the probability that that you will make to through the queue within $20$ minutes.   Make clear any assumptions you are using for your calculations/simulations.  Part of this exericse is to come up with reasonable modelling assumptions.    Give one answer than you can do without any complicated calculations--like one that you can perform while you are running and deciding if you will make it or now, and give another  answer that you think is more accurate and makes better use of the available information.  Discuss the differences in your numerical answers.  




## Question 4 [10 points]

Consider two queues both with exponential service  rate $\mu$, where $\mu > \lambda>0$---for both queues the arrival rate is $\lambda$.  Suppose also that I know more about the distribution of the arrivals for the queues.      I am interested in picking the one with the least average waiting time in the system,  where both queues have been in operation for a long time.  Does it matter which queue I pick?  Support your answer with code and/or theory.   


  

## Question 5  [10 points]

Consider a Poisson point process $\Gamma$ of intensity $2$ on the interval $[-1,1]$.  Suppose that I modify this point process on the interval $[0,1]$, where I delete points independently with probability $\tfrac{1}{2}$, and we obtain a new point process $\Pi$ consisting of possibly fewer points than $\Gamma$.

* Let $N = \Pi[-1,1]$ be the total number of points of $\Pi$. 
  * What is $\mathbb{E} N$? [2 points]
  * What is the distribution of $N$? [3 points]

* Suppose that there is exactly one point in the interval $[-0.5,0.5]$---let $V$ be the location of this point.  What is the distribution of $V$?  [5 points]



<br>
<br>

## Endnotes

* [Source](https://tsoo-math.github.io/ucl5/2024-ica3-release.Rmd)
* Version: `r format(Sys.time(), '%d %B %Y')`



<br>
<br>
<br>
