Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the complete Python code for the question. Thank you. arrive at the YouBike station in a discrete-time sequence, say, t={1,2,3,}. There are two

I need the complete Python code for the question. Thank you. image text in transcribed
arrive at the YouBike station in a discrete-time sequence, say, t={1,2,3,}. There are two types of arriving customers: Type I: Customer who wants to rent a bike; Type II: Customer who wants to return a bike. Suppose the "type" of every customer arriving at the YouBike station is "random", say, P(customerisType1)=p1andP(customerisTypeII)=p2,p1+p2=1. If an arriving customer is Type I and at least one bike is available on the dock, then a bike is successfully rented; otherwise, the customer will leave the station right away (thus being lost). If an arriving customer is Type II and at least one dock is empty, then a bike is successfully returned; otherwise, the customer will leave the station right away. Let Xt be the number of bikes available on docks at time t, and assume Xt can be modeled as a (discrete-time) Markov chain with one-step transition probabilities pij=P(Xt=jXt1=i),wherei,j=0,1,,4 Let p1=0.6,p2=0.4, and X0=2 ( 2 bikes on docks at time 0). Answer the following questions in order: (a) (5pts) Write down an algorithm with detailed steps to simulate this YouBike system. The algorithm should at least record all the event times, the evolution of Xt and the number of events transiting from state i to j. (b) (5pts) Suppose we want to estimate all non-zero transition probabilities pij(i,j= 0,1,,4 ) based on the simulation. Then, what is the required simulation length (or when to stop the simulation) so that with a 95% confidence we can say that all estimates p^ij have the margin of error less than 2% ? Clearly address all necessary steps to obtain the answer. [Hint: With a 95% confidence level, the margin of error for estimating each pij has an upper bound 1.96nij0.25. Use this upper bound to determine the required

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

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions