Bank Teller Problem

Embed Size (px)

Citation preview

  • 8/20/2019 Bank Teller Problem

    1/16

    i)

    This problem deals with calculating average wait time for customers in order to determine

    whether or not to hire a second teller. However, in order to do so, you must write a program to

    approximate the average wait time of customers for n tellers. To implement this, each customer

    is considered to have an Arrival Event and a Departure Event. Each Arrival Event holds the

    incoming customers arrival time to the ban!, and the length of his or her transaction. EachDeparture Event holds the departure time of the specified customer "when the customer is

    finished with his or her transaction and the teller he or she was using is now available). #f the

    customer is first in the ban! line, or the ban! line is empty, the customers Arrival Event is

    deleted and the customer is processed, and a Departure Event is created. #f the ban! line is not

    empty, the customer is put in the bac! of the ban! line. This allows for the total wait time of each

    customer to be calculated, as $ustomer %s wait time will be the departure time of $ustomer A

    minus the arrival time of the $ustomer % "assuming $ustomer A is in front of $ustomer %). After

    finding each customers wait time, the individual wait times are summed up, and then divided by

    the total amount of customers to find the average wait time of each customer.

    &se $ase

    &ser'(resident of %an! wants to determine whether or not to hire more tellers. &ser runs

    simulation for certain data set containing arrival times and transaction length of any number of

    customers in order to determine average wait time for those customers based on the given data.

    imulation re*uests user to input number of tellers available. &ser inputs number of tellers

    available. imulation determines wait time for each individual customer, and pushes each wait

    time into a vector. &ser finds average wait time by summing up each individual wait time in

    vector and dividing by the total number of customers. &ser compares the average wait time with

    his or her standard for whether or not to hire more tellers. #f the average wait time meets

    standard to hire more tellers, more tellers are hired. +therwise, user does nothing or runs

    simulation again with a different data set.

    ii)

    ee scanned pdf in folder labeled (roblem , or loo! at hard copy attached.

    iii)

    ee .cpp file in folder labeled (roblem -. To run this code, simply compile it how you would

    normally run a $ program. # attached a test.txt file that has a uniform distribution of arrival

    times and a transaction time of / "used in problem 0), but if you want to test it on your own text

    file, rename the file test.txt and run the program. 1+TE2 the program will have the user input the

    number of tellers.

    iv)

    / Teller2 00.33 minutes or 45- seconds

    Tellers2 /6.4 minutes or //54 seconds

    /7 Tellers2 7 minutes or 7 seconds "ma!es sense since /7 customers arrive each minute)

    %elow are screenshots of the result for / Teller, Tellers, and /7 Tellers, respectively.

  • 8/20/2019 Bank Teller Problem

    2/16

  • 8/20/2019 Bank Teller Problem

    3/16

  • 8/20/2019 Bank Teller Problem

    4/16

    Extra $redit)

     A (oisson Distribution is given by the e*uation2

  • 8/20/2019 Bank Teller Problem

    5/16

    "reference2 wi!ipedia.com)

    # use lambda 8 7./, because the expected values of incoming customers based on the uniform

    distribution from problem - is 7./, since customers come every 7./ minutes, and lambda e*uals

    Expected 9alue for (oisson Distribution.

     An Exponential distribution is given by the e*uation2

    "reference2 wi!ipedia.com)

    # use lambda 8 /, because the expected values of incoming customers based on the uniform

    distribution from problem - is 7./, since customers come every 7./ minutes, and lambda e*uals

    /'Expected 9alue for Exponential Distribution.

    ::::1+TE2 ince problem - has every person coming at every 7./ minutes, rather than /77

    people coming at 7./ minutes, # calculated the arrival time of customer i as y 8 y (oisson

    Distribution of i, where y is initially 7, and i is from 7 to 66.

     As one can clearly see, both of these distributions converge to ;ero. Thus, eventually, the

    incoming customers will begin to come at the exact same time. This occurs at / minute.

  • 8/20/2019 Bank Teller Problem

    6/16

    Tellers2

  • 8/20/2019 Bank Teller Problem

    7/16

    - Tellers2

  • 8/20/2019 Bank Teller Problem

    8/16

    0 Tellers2

  • 8/20/2019 Bank Teller Problem

    9/16

    3 Tellers2

  • 8/20/2019 Bank Teller Problem

    10/16

    4 Tellers2

  • 8/20/2019 Bank Teller Problem

    11/16

    5 Tellers2

  • 8/20/2019 Bank Teller Problem

    12/16

    ? Tellers2

  • 8/20/2019 Bank Teller Problem

    13/16

    6 Tellers2

  • 8/20/2019 Bank Teller Problem

    14/16

    /7 Tellers2

  • 8/20/2019 Bank Teller Problem

    15/16

    %elow is a table of all the data, and a graph generated by @ATA%2

    Number of Tellers Average Wait Time (Minutes)

    / /.0-??

    7.3-?-5-

    - 7./?-?76

  • 8/20/2019 Bank Teller Problem

    16/16

    0 7.734??

    3 7.770??5-3

    4 7.77756674

    5 7.777/4045

    ? 7.7777/63/3?

    6 7.7777750570

    /7 7.777770/?

     As one can see, the average wait time exponentially decreases.