zhaw-dps-sw03-exercise
Exercise 3
M/M/1 Waiting Queue Network
Please model the process at a busy café as an M/M/1 waiting queue network. The system consists of four stations. At the first station, the order is taken for each customer. On average, each 30 seconds a customer arrives. 3 orders can be taken per minute. 9 out of 10 customers order a beverage (but no meal). 1 out of 10 customers orders a meal (but no beverage). Two beverages can be prepared per minute. One meal can be prepared per minute. After either the beverage or the meal is prepared, the payment is made. Five payments can be conducted per minute. However, due to severe problems with payment processing, 50% of the payments need to be repeated.
1)
What is the expected waiting time for ordering (solution: 1 minute)?
What is the expected waiting time for beverage preparation (solution: 5 minutes)?
What is the average number of orders in meal preparation (queue and service) (solution: 0.25 orders)?
2)
What is the expected waiting time for payment (queue and service) (solution: 1 minute)?
What is the expected number of orders in the complete system consisting of the four stations (solution: 15.25)?
How long do customers spend on average to go through the whole process (solution: 6.625)?
Service Price Optimization with one and two segments
You work for a provider of educational services which offers online courses over the internet. The service provider is not satisfied with the current profit situation and asks you to assess the possibility to switch from addressing just a single customer segment to providing a basic offering and a complete offering with additional content to address customers with a higher willingness to pay. The market research department gave you the information that the prohibitive price is CHF 80. At a price point of CHF 10, they estimate 35,000 customers. The variable cost per customer is CHF 10.
3)
You assume a linear demand function of the form
How would the optimal price
4)
How much would your profit increase (
5)
How high would be your optimal profit in the theoretical scenario of individual price segments? (solution:
6)
What would the profit function look like for a segmentation with 3 segments? First, create a graph and then specify the formula
Now suppose that the addition of each segment causes CHF 50000 in fixed costs. Calculate the optimal number of segments and the associated profit. (Tip: Use the scipy.optimize library in Python, analogous to the 2-class solution presented in the lecture.) (solution: Four segments and optimal profit: CHF 779996)
import numpy as np
import scipy.optimize as optimize
# Demand parameters
a=40_000
b=500
c=10
def Y(r):
return a-(b*r)
def revenue(r):
s = Y(r[0]) * (r[0] - c)
for i in range(1, len(r)):
s += (Y(r[i]) - Y(r[i - 1])) * (r[i] - c)
return -1 * s
# Simulation parameters
cost_pre_segment=50000
n_segments = 1
current_revenue = 0
last_revenue = 0
best_revenue = 0
best_segments = 0
while True:
result = optimize.minimize(revenue, np.linspace(10, 80, n_segments), method="Powell")
current_revenue = -1 * result.fun
current_revenue -= cost_pre_segment * n_segments
if not result.success:
raise ValueError(result.message)
if current_revenue < last_revenue:
best_revenue = last_revenue
best_segments = n_segments - 1
break
last_revenue = current_revenue
n_segments += 1
print(f"Segments: {best_segments}")
print(f"Mex revenue: {best_revenue}")