a guest Jul 27th, 2017 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \section{Overview}
  3.   Suppose that a new grocery store is opening in Mansfield.  The managers are trying to figure out what is the optimal number of cash registers to have operating.  Each one requires an employee, so they would prefer as few as possible.  However, if customers have to wait too long to check out, they will take their business elsewhere.  Based on data observed from their other stores, they have developed the following model:
  5.   \begin{itemize}
  6.     \item Every second there is a 5\% probability that a customer will finish their shopping.  [This is, of course, a simplification.  In real life the store will be much busier during some parts of the day than others.]
  7.     \item Each register has its own line.
  8.     \item Whenever a customer is finished, they will get in the shortest line.  If multiple lines are tied for shortest, the customer selects one arbitrarily.  [This is also a simplification.  Real customers might count the items in people's carts to try to figure out which line will move more quickly.]
  9.     \item Once a customer chooses a line, they will not switch.
  10.     \item The number of items that a customer purchases is uniformly distributed between 1 and 40 inclusive.  [This too is a simplification; a normal or perhaps bimodal distribution seems more likely.]
  11.     \item The total time for a transaction is 20 seconds plus 3 seconds per item.
  12.     \item Customers are willing to wait in line for 60 seconds.  Beyond that, they will be angry.
  13.   \end{itemize}
  15.   In order to determine what they should do, the store manager has asked you to write a program that will simulate the flow of customers through their store.  Your program should simulate 100000 seconds of the store's operation.  First run the simulation with a single cash register open and record the average wait time for customers.  If this is greater than 60 seconds, try again with two registers.  Continue until the average wait time is less than 60 seconds.
  17. \section{Bonus Challenge}
  19.   Sorry, no extra credit.  But if you finish this and are interested in expanding the simulation, consider adding some registers that are ``15 items or less''.  Only customers that meet the requirements will be allowed to enter the line for these registers.  If you convert one or more registers to this type, can you use fewer total registers and still get average wait time below 60 seconds?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand