During the dinner hour, the distribution of the inter-arrival time of customers at a restaurant is estimated to be as shown below. The mode of payment and the service times of the cash and credit card customers are shown in the following tables. Complete the tables and simulate the system for 20 customer arrivals and determine the average time a cash and credit card customer must wait in line before paying the cashier. Use Column A of the given random number table to determine the customer inter-arrival time, Column B to determine whether the customer pays with cash or credit, and Column C to determine the service time.

Inter-arrival time
Inter-arrival Time Probability Cumulative Probability Random Number Interval
30 seconds 0.45
60 seconds 0.25
90 seconds 0.15
120 seconds 0.10
150 seconds 0.05

Mode of Payment
Payment Mode Probability Cumulative Probability Random Number Interval
Cash 0.6
Credit Card 0.4

Cash Service Time
Service Time Probability Cumulative Probability Random Number Interval
20 seconds 0.35
40 seconds 0.30
60 seconds 0.25
80 seconds 0.10


Credit Card Service Time
Service Time Probability Cumulative Probability Random Number Interval
30 seconds 0.20
60 seconds 0.45
90 seconds 0.25
120 seconds 0.10

Random Numbers
(A) (B) (C)
6320 1094 1995
4630 7371 7971
8657 2809 3554
0030 5148 6300
5624 9115 5495
6728 1469 5165
5925 6480 9339
2829 2447 6997
7939 7031 1443
6476 8442 3574
3319 7387 0150
8134 1788 0933
1712 4891 7082
6317 1149 5025
6605 8822 4081
2734 9451 4100
0432 2990 7190
3441 8314 6822
0726 7176 5053
6969 2766 8284

Complete the table below to show the results of the simulation.

Customer Random Number Arrival Time Random Number Mode of Payment Random Number Service Time Service Time Waiting Time
Begins Ends Cash Credit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Average Waiting Time (Cash)=
Average Waiting Time (Credit)=

To complete the table and simulate the system, you will need to follow these steps:

Step 1: Calculate Cumulative Probability for Inter-arrival Time, Mode of Payment, Cash Service Time, and Credit Card Service Time.

To calculate the Cumulative Probability, you need to sum up the probabilities for each outcome up to that point.

For the Inter-arrival time:
- Cumulative Probability for 30 seconds = 0.45 (given)
- Cumulative Probability for 60 seconds = Cumulative Probability for 30 seconds + Probability for 60 seconds = 0.45 + 0.25 = 0.70
- Cumulative Probability for 90 seconds = Cumulative Probability for 60 seconds + Probability for 90 seconds = 0.70 + 0.15 = 0.85
- Cumulative Probability for 120 seconds = Cumulative Probability for 90 seconds + Probability for 120 seconds = 0.85 + 0.10 = 0.95
- Cumulative Probability for 150 seconds = Cumulative Probability for 120 seconds + Probability for 150 seconds = 0.95 + 0.05 = 1.00 (because it's the last value)

For the Mode of Payment:
- Cumulative Probability for Cash = 0.6 (given)
- Cumulative Probability for Credit Card = Cumulative Probability for Cash + Probability for Credit Card = 0.6 + 0.4 = 1.00

For the Cash Service Time:
- Cumulative Probability for 20 seconds = 0.35 (given)
- Cumulative Probability for 40 seconds = Cumulative Probability for 20 seconds + Probability for 40 seconds = 0.35 + 0.30 = 0.65
- Cumulative Probability for 60 seconds = Cumulative Probability for 40 seconds + Probability for 60 seconds = 0.65 + 0.25 = 0.90
- Cumulative Probability for 80 seconds = Cumulative Probability for 60 seconds + Probability for 80 seconds = 0.90 + 0.10 = 1.00

For the Credit Card Service Time:
- Cumulative Probability for 30 seconds = 0.20 (given)
- Cumulative Probability for 60 seconds = Cumulative Probability for 30 seconds + Probability for 60 seconds = 0.20 + 0.45 = 0.65
- Cumulative Probability for 90 seconds = Cumulative Probability for 60 seconds + Probability for 90 seconds = 0.65 + 0.25 = 0.90
- Cumulative Probability for 120 seconds = Cumulative Probability for 90 seconds + Probability for 120 seconds = 0.90 + 0.10 = 1.00

Step 2: Fill in the table with the simulation results.

For each customer, you need to generate random numbers for Inter-arrival Time, Mode of Payment, and Service Time using the given random number table. Then, determine the actual values based on the random numbers generated.

- Customer: Start from 1 and go up to 20.
- Random Number for Arrival Time: Use Column A of the given random number table.
- Random Number for Mode of Payment: Use Column B of the given random number table.
- Random Number for Service Time: Use Column C of the given random number table.
- Inter-arrival Time: Determine the time based on the random number using the Cumulative Probability for Inter-arrival Time table.
- Mode of Payment: Determine whether it's cash or credit card based on the random number using the Cumulative Probability for Mode of Payment table.
- Service Time: Determine the time based on the random number and mode of payment using the Cumulative Probability for Cash Service Time or Credit Card Service Time table.
- Waiting Time: Calculate the waiting time by subtracting the previous customer's arrival time + service time from the current customer's arrival time.

Step 3: Calculate the Average Waiting Time for Cash and Credit Card customers.

To calculate the average waiting time for cash and credit card customers, you need to sum up the waiting times for each customer and divide it by the total number of customers.

- Average Waiting Time (Cash) = Sum of waiting times for cash customers / Total number of cash customers.
- Average Waiting Time (Credit) = Sum of waiting times for credit card customers / Total number of credit card customers.