Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in r code please 1. [25 marks] Suppose Nt denotes the number of people in a queue for a pint of beer at time t

in r code please image text in transcribed

1. [25 marks] Suppose Nt denotes the number of people in a queue for a pint of beer at time t (in minutes). Assume that There are no people in the queue at time t=1, The number of customers joining the queue at each time point follows a Poisson distribu- tion with rate = 2, A fixed number of customers u - 20 leave the queue at times t = 10, 20, 30, 40, 50, ... (i.e. every ten minutes), (Hint: use the modulo operator %%) When departures do occur, they happen after the arrivals which also occur at the same t, The bar stops serving alcohol when the size of the queue reaches the bar's capacity of 50 people; otherwise, the bar stays open 'forever'. (a) [12 marks] Write a while loop which determines the time t when the bar shuts down and the number of customers N4 who were actually in the queue at this exact time. Do so by filling in the blanks in the code chunk below: > N join while(BLANK) { N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions