Question: Create program, first, prompt the user for a # of years to enter for a player. Then, prompt the user for the player's starting year
Create program, first, prompt the user for a # of years to enter for a player. Then, prompt the user for the player's starting year and then read in the statistics of the player for each of those years. The program should finish by printing out the highest year and lowest year for the player. It should behave like the sample below:
Sample 1
# of years: 5
Starting year: 1999
Stat for year 1999: 4
Stat for year 2000: 3
Stat for year 2001: 8
Stat for year 2002: 10
Stat for year 2003: 12
Best stat was 12 in year 2003
Worst stat was 3 in year 2000
Sample 2
# of years: 6
Starting year: 2012
Stat for year 2012: 85
Stat for year 2013: 36
Stat for year 2014: 77
Stat for year 2015: 32
Stat for year 2016: 10
Stat for year 2017: 48
Best stat was 85 in year 2012
Worst stat was 10 in year 201



Problem 1: 15 points = [5 + 5 + 5] A small hair dresser shop operates with three hair stylists. It has two waiting seats so that when new customers arrive and all stylists are busy and there is no vacant seat, they leave. The state space S of this "birth-and-death" process is S = {0, 1, 2, 3, 4,5} . where r E S indicates the number of customers either waiting or having the ongoing service. When 1 5. 1. Derive the stationary distribution for a number of customers in the shop. 2. Determine the limiting probability of the idle state, a = 0, that is: lim P [X (t) = 0] 1-+00 3. Determine the limiting probability of losing customers because the shop is full, that is: lim P [X (t) = 5] 1-100Q2. My home uses two light bulbs. On average, a light bulb last for 22 days (expo- nentially distributed). When a light bulb burns out, it takes and average of 2 days (exponentially distributed] before I replace the bulb. (a) Formulate a three-state birth and death process of this situation. (b Determine the fraction of the trne that both light bulbs are working. ) ((3) Determine the fraction of the time that no light bulbs are working. ) ((1 Suppose that Whenever a bulb burns out, a fixed failure cost of 5 dollars is incurred. Moreover, when any of the bulb is not working, an inconvenience cost of 1 dollar per bulb per day is incurred. Determine the long run cost per day for this system. 3. (3.) During lunch hour, arrivals of customers at a pizza hut restaurant follows a Poisson process with the rate of 120 customers per hour. The restaurant has one line, with three workers taking food orders at independent services stations. Each worker takes an exponen- tially distributed amount of time-on average 1 minute-to serve a customer. Let Xt denote the number of customers in the restaurant (in line and being serviced) at time t. Then, the process (X: : t 2 0) is a continuous-time Markov chain. (1) Show that the process is a birth-and-death process by giving the birth and death rates. :4 marks] (ii) Find the generator matrix of the above process. :5 marks] (iii) For each integer k 2 0, derive the long-term probability that there are in customers in the restaurant. :8 marks] (iv) Calculate the long-term probability that all three workers are busy. :6 marks] [v] Find the average munber of customers in the restaurant in the long term. :7 marks] (b) A student support center has 3 tutors who help students with their home work. Students arrive at the center according to a Poisson process at rate A = 3 per hour. Each tutor's service time is exponentially distributed with average of 1/10 hours. Tutors' service times and student arrival times are independent. If all the tutors are busy when a student arrives at the center, the student will leave. Let Xt denote the number of tutors who are busy at time t. Determine its generator matrix and stationary distribution. [10 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
