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)?

WS1=ρ1λ1(1ρ1)λ1=2 customer/minμ1=3 orders/minρ1=23=0.6WS1=0.62(10.6)=1

What is the expected waiting time for beverage preparation (solution: 5 minutes)?

WS2=ρ2λ2(1ρ2)p2=0.9λ2=λ1p2=1.8μ2=2ρ2=1.82=0.9WS2=0.91.8(10.9)=5

What is the average number of orders in meal preparation (queue and service) (solution: 0.25 orders)?

LS3=ρ31ρ3p3=0.1λ3=λ1p3=0.2μ3=1ρ3=0.2LS3=0.210.2=0.25

2)

What is the expected waiting time for payment (queue and service) (solution: 1 minute)?

WS4=ρ4λ4(1ρ4)p4=0.5λ4=λ2+λ3=2μ=5λ4=λ41p=210.5=4ρ4=λ4μ=45=0.8WS4=0.84(10.8)=1

What is the expected number of orders in the complete system consisting of the four stations (solution: 15.25)?

LS=iLSi=LS1+LS2+LS3+LS4LS=ρ11ρ1+ρ21ρ2+ρ31ρ3+ρ41ρ4ρ1=23ρ2=0.9ρ3=0.2λ4=λ41p=20.5=4ρ4=45LS=23123+0.910.9+0.210.2+45145=15.25

How long do customers spend on average to go through the whole process (solution: 6.625)?

WS=ipiWSi=WS1+WS2+WS3+WS4λ1=2λ2=1.8λ3=0.2λ4=4WS=232(123)+0.90.91.8(10.9)+0.10.20.2(10.2)+452(145)WS=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 y(r)=abr. Please calculate a and b. (Solution: a=40000 und b=500).

P0(10)=35000P1(80)=0b=Δy(r)Δr=3500001080=5000=a50080a=50080=40000

How would the optimal price r and the profit Π(r) look like, if the service provider decides against service differentiation? (Solution: r=55 und Π(r)=612500)

r=a+bc2b=40000+500102500=45Π(r)=(abc)24b=(40000+50010)24500=612500

4)

How much would your profit increase (ΔΠ), if you included a second price segment? Which price points (r1 and r2) would be optimal? (Solution: r1=56.67, r2=33.33, ΔΠ=204166.67)

r1=2a+bc3b=240000+500103500=56.6r2=a+2bc3b=40000+2500103500=33.3Π(r1,r2)Π(r1)=(abc)23b612500=204166.6

5)

How high would be your optimal profit in the theoretical scenario of individual price segments? (solution: 1225000)

Π=(abc)22b=1225000

6)

What would the profit function look like for a segmentation with 3 segments? First, create a graph and then specify the formula Π(r1,r2,r3). (Hint: The graph and formula builds on the graphical representation of the "Price Optimization: Continuous Demand Function with 2 Segments" slide.).

Y(r)=abrΠ(r1,r2,r3)=(Y(r3)Y(r2))(r3c)+(Y(r2)Y(r1))(r2c)+Y(r1)(r1c)=(abr3a+br2)(r3c)+(abr2a+br1)(r2c)+(abr1)(r1c)=br32br22+ar1acbr12+bcr3+br3r2+br2r1

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)

Π(r1,,rk)=Y(r1)(r1c)+k=2n(Y(rk)Y(rk1))(rkc)
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}")