ISE / SYS 5517 · WEEK 7 · SELF-STUDY

排队论
从一个等待队列开始

Queueing Theory
Starting with one waiting queue

详细自学讲义 · 中英逐段对照 / Detailed bilingual self-study

计算器 / Calculator公式表 / Formulas

学习路线:这周到底在学什么

Study roadmap: what are we learning this week?

三讲总览

排队论研究:任务怎样到达、怎样等待、怎样接受服务,以及怎样离开。我们想知道平均积压多少任务、每个任务等多久、设备多忙、队列满的概率多大。

Queueing theory studies how jobs arrive, wait, receive service, and depart. We want to find the average backlog, average delay, resource utilization, and probability of a full system.

把场景换成你熟悉的软件:请求进入消息队列,工作线程逐个处理请求。一个请求相当于一个顾客,一个工作线程相当于一个服务器。这里的 server 不一定是一台计算机,也可以是店员、维修工或一台机器。

In software, requests enter a message queue and worker threads process them. A request is a customer; a worker thread is a server. A server may also be a clerk, repair technician, or machine.
学习层次Learning stage本文件内容Coverage in this handout学完能做什么Learning outcome
第一层 · 概念Stage 1 · Concepts第 1—5 节:人数、时间、速率、模型符号Sections 1–5: population, time, rates, and notation读懂题目,不把速率和时间混淆Read problems and distinguish rates from durations
第二层 · 核心Stage 2 · Core model第 6—11 节:M/M/1 推导与面包店Sections 6–11: M/M/1 derivations and bakery example独立计算 π、L、Lq、W、WqCalculate π, L, Lq, W, and Wq independently
第三层 · 扩展Stage 3 · Extensions第 12—17 节:有限容量、多服务器、有限来源Sections 12–17: finite capacity, multiple servers, finite sources识别模型,正确修改到达和服务速率Identify models and adjust arrival and service rates correctly
第四层 · 运用Stage 4 · Applications第 18—22 节:课件对照、计算器、练习、公式表Sections 18–22: slide guide, calculator, exercises, formula reference带着课件复习,检查自己的计算Review alongside the slides and check calculations

符号约定:πn 是系统人数的稳态概率;pq,j 是等待人数的概率。课件把后者写为 qj,这里换个写法,避免与马尔可夫链速率 qij 混淆。多服务器统一用 a=λ/μ 表示 offered load,ρ=λ/(cμ) 表示利用率,防止同一个 ρ 在不同课件页中含义变化。

Notation: πₙ is the stationary probability of n customers in the system; p(q,j) is the probability of j customers waiting. The slides use qⱼ for the latter. We use a=λ/μ for offered load and ρ=λ/(cμ) for multi-server utilization to keep the meanings distinct.

1.系统、队列、服务器:先把边界画清楚

1. System, queue, and server: define the boundary

Lecture 1 · slides 2, 5–6
等待队列 QueueWaiting queue

顾客 A 顾客 B 顾客 C

Customer A · Customer B · Customer C
尚未开始服务Service has not started
服务器 ServerServer

顾客 D

Customer D
正在服务In service
以上两部分合起来:系统 System(共 4 人)System boundary: both parts together (4 customers)

假设一个店员正在服务 1 人,另外 3 人等待:

Suppose one clerk is serving one customer and three more customers are waiting.
N = 4,Nq = 3,忙碌服务器数 = 1
N = 4,Nq = 3,Busy servers = 1

N 是某个时刻的实际系统人数,是整数;L 是长期平均系统人数,可以是 2.25、3.7 这样的非整数。

N is the actual number in the system at a particular time and is an integer. L is a long-run average and may be a non-integer such as 2.25 or 3.7.
术语Term英文English解释Explanation
顾客CustomerCustomer任何需要占用服务资源的对象:人、网络包、磁盘请求、故障机器An object requiring service: a person, network packet, disk request, or failed machine
服务资源ServerServer同一时刻为顾客提供服务的资源A resource that serves a customer
服务时间Service timeService time从开始处理到处理完成的时间Time from service start to service completion
排队规则Queue disciplineQueue discipline决定下一次轮到谁The rule selecting the next customer
系统容量System capacitySystem capacity正在服务和等待的顾客总数上限Maximum total population, including service and waiting
来源总体Source populationSource population所有可能产生请求的对象集合The set of all potential request-generating sources

2.用课件的 17 个顾客练习“什么时候开始服务”

2. Work through the 17 customers in the slides

Lecture 1 · slides 3–4

本例先不用任何概率公式。我们知道每位顾客的实际到达时间和实际服务时长,逐个算开始、结束和等待时间。假设 9:00 系统为空,先到先服务。

No probability formula is needed here. Given actual arrival times and service durations, calculate each customer's service start, completion, and waiting time. Assume an empty system at 9:00 and first-come, first-served service.
开始时间 Bi = max(到达时间 Ai, 上一位完成时间 Di−1)
Start time Bi = max(Arrival time Ai, Previous completion Di−1)
完成时间 Di = Bi + 服务时长 Si
Completion time Di = Bi + Service duration Si
等待时间 = Bi − Ai;总时间 = Di − Ai
Queue waiting time = Bi − Ai;Total time = Di − Ai

第一人:9:03 到,店员空闲,立刻开始。服务 4 分钟,9:07 完成,等待 0 分钟。

Customer 1 arrives at 9:03 and starts immediately because the clerk is idle. Service takes 4 minutes, ends at 9:07, and involves no waiting.

第二人:9:05 到,第一人还没结束。9:07 开始,等待 2 分钟;服务 1 分钟,9:08 完成,总时间 3 分钟。

Customer 2 arrives at 9:05 while customer 1 is still in service. Service begins at 9:07 after a 2-minute wait, takes 1 minute, and ends at 9:08. Total time is 3 minutes.

第三人:9:07 到,第二人已经排在前面。9:08 开始,等待 1 分钟;服务 2 分钟,9:10 完成。

Customer 3 arrives at 9:07, behind customer 2. Service begins at 9:08 after a 1-minute wait, lasts 2 minutes, and ends at 9:10.
顾客Customer到达Arrival服务 / 分Service / min开始Start完成Completion等待 / 分Queue wait / min总时间 / 分Total time / min
109:03409:0309:0704
209:05109:0709:0823
309:07209:0809:1013
409:09309:1009:1314
509:10109:1309:1434
609:12209:1409:1624
709:13109:1609:1734
809:15209:1709:1924
909:20209:2009:2202
1009:22209:2209:2402
1109:23309:2409:2714
1209:26109:2709:2812
1309:27109:2809:2912
1409:30209:3009:3202
1509:33409:3309:3704
1609:36409:3709:4115
1709:40209:4109:4313

这 17 人实际等待时间之和为 19 分钟,平均等待 1.118 分钟;实际总时间之和为 56 分钟,平均总时间 3.294 分钟。

For these 17 customers, total waiting time is 19 minutes and the sample mean is 1.118 minutes. Total time in the system is 56 minutes and its sample mean is 3.294 minutes.

3.λ、μ 及其倒数:单位必须先统一

3. λ, μ, and their reciprocals: use consistent units

Lecture 2 · slides 4, 10–11

λ(lambda)是平均到达速率。μ(mu)是每个服务器持续忙碌时的服务完成速率。两者可以用“人/小时”“任务/秒”等表示。

λ (lambda) is the mean arrival rate. μ (mu) is the completion rate of each server while continuously busy. Typical units are customers per hour or jobs per second.
已知Given转换Conversion意思Interpretation
λ=15 人/小时λ=15 customers/hour1/λ=1/15 小时=4 分钟1/λ=1/15 hour=4 minutes平均每隔 4 分钟来一人Mean interarrival time: 4 minutes
μ=20 人/小时μ=20 customers/hour1/μ=1/20 小时=3 分钟1/μ=1/20 hour=3 minutes平均服务一人需要 3 分钟Mean service time: 3 minutes
平均每 5 分钟来一个One arrival every 5 minutes on averageλ=60/5=12 人/小时λ=60/5=12 customers/hour先求倒数,再换单位Take the reciprocal and convert units
平均服务 2 分钟Mean service time: 2 minutesμ=60/2=30 人/小时μ=60/2=30 customers/hour不是 μ=2μ is 30/hour, not 2

例:λ=15/小时,μ=20/小时,差值 μ−λ=5/小时,所以 1/(μ−λ)=0.2 小时,最后才换成 12 分钟。

Example: λ=15/hour and μ=20/hour give μ−λ=5/hour. Therefore 1/(μ−λ)=0.2 hour, which is then converted to 12 minutes.

μ 不是整个系统实际每小时一定完成的人数。在稳态、没有流失的单服务器例子中,实际吞吐率为 15 人/小时,因为店员有时空闲。20 人/小时描述忙碌时的能力。

μ is not the number that the system must actually complete every hour. In this stable single-server example with no losses, actual throughput is 15 customers/hour because the clerk is sometimes idle. The rate 20/hour describes capacity while busy.

4.泊松分布与指数分布:数次数,还是量时间?

4. Poisson and exponential distributions: count events or measure time?

Lecture 1 · slide 7;与 Week 6 衔接

设顾客按速率 λ 的泊松过程到达。同一件事情可以问两个不同的问题。

Suppose arrivals follow a Poisson process with rate λ. There are two different questions about this process.
问题Question随机变量Random variable分布Distribution
接下来 t 小时来了多少人?How many arrive during the next t hours?到达次数 K(t)Arrival count K(t)Poisson(λt)
等多久来下一个人?How long until the next arrival?相邻到达间隔 AInterarrival time AExponential(λ)
P(K(t)=k) = e−λt(λt)k/k!
P(A>t) = e−λt;E[A]=1/λ

若 λ=15 人/小时,问“未来 4 分钟来几个人”,先把 4 分钟写成 1/15 小时,泊松参数就是 λt=1。因此这 4 分钟恰好来 0 人的概率为 e−1≈0.3679,恰好来 1 人的概率也为 e−1≈0.3679。

For λ=15 customers/hour, a 4-minute interval is 1/15 hour, so the Poisson parameter is λt=1. The probability of zero arrivals is exp(−1)≈0.3679, and the probability of exactly one arrival is also exp(−1)≈0.3679.

问“下一个人还要等超过 4 分钟才来”的概率,同样是 e−1。两个问题相关,但随机变量不同。

The probability that the next arrival is more than 4 minutes away is also exp(−1). The questions are related, but the random variables differ.

如果服务固定需要 3 分钟,一个人已经服务了 2 分钟,那么剩余就是 1 分钟,历史已服务时长会影响预测。此时只记录人数通常不足以描述连续时间马尔可夫状态。

If service always takes exactly 3 minutes and 2 minutes have elapsed, only 1 minute remains. Elapsed service time now affects prediction. Population alone is generally insufficient to specify a continuous-time Markov state.

5.Kendall 命名:M/M/c/N/N 每一项指什么

5. Kendall notation: what does each position mean?

Lecture 1 · slide 7
到达间隔分布 / 服务时间分布 / 服务器数 / 系统容量 / 来源总体大小 / 排队规则
Interarrival distribution / Service-time distribution / Server count / System capacity / Source population size / Queue discipline
符号Symbol含义Meaning例子Example
M指数间隔或指数服务时间(Markovian)Exponential interarrival or service times (Markovian)M/M/1 的前两个位置The first two positions of M/M/1
D固定不变(Deterministic)Constant duration (deterministic)每次处理都正好 3 分钟Exactly 3 minutes for every service
EₖErlang-kk 个独立同速率指数阶段之和Sum of k independent exponential stages of equal rate
GI独立同分布的一般到达间隔General independent, identically distributed interarrival times不要求指数分布Not necessarily exponential
G一般服务时间分布General service-time distribution不要求指数分布Not necessarily exponential
FCFS / FIFO先到先服务First come, first served按到达顺序In arrival order
LCFS / LIFO后到先服务Last come, first served最后进来的先处理Most recent arrival served next
RSS随机选择下一位Random selection of the next customer从等待者中随机取一位Choose randomly among waiting customers

M/M/1 表示一个服务器,泊松到达、独立同分布的指数服务,服务时间与到达过程独立。未写出的后三项通常为无限容量、无限来源、FCFS。

M/M/1 means one server, Poisson arrivals, and independent, identically distributed exponential service times independent of the arrival process. Omitted positions normally mean infinite capacity, an infinite source population, and FCFS.

M/M/2/5 表示 2 个服务器,系统最多 5 人。因此最多 3 人等待。

M/M/2/5 means two servers and at most five customers in the system, so at most three can wait.

M/M/3/3 表示 3 个服务器、系统最多 3 人。没有人能站在旁边等待:全部忙时就拒绝新到达。

M/M/3/3 means three servers and capacity for three customers. There is no waiting room; an arrival is rejected when all servers are busy.

M/M/1/N/N 的两个 N 分别是容量与来源大小。最后一个 N 的重要影响是到达速率随当前人数变化。

In M/M/1/N/N, the two N values denote system capacity and source population. The finite source population makes the total arrival rate depend on the current state.

6.四个平均指标,以及 π、B、R、U

6. Four mean measures, plus π, B, R, and U

Lecture 2 · slides 2–3
符号Symbol英文English含义Meaning单位Units
LMean number in system平均系统人数,含服务中的人Mean population in the system, including service人customers
LqMean number in queue平均等待人数Mean number waiting人customers
WMean time in system平均从进入到离开的总时间Mean time from entry to departure小时或分钟hours or minutes
WqMean waiting time in queue平均开始服务前的等待时间Mean time before service starts小时或分钟hours or minutes
πₙStationary probability系统里恰好 n 人的长期概率Long-run probability of exactly n customers in the system无单位dimensionless
BMean busy servers平均忙碌服务器数Mean number of busy servers个servers
RThroughput实际通过系统的速率Actual throughput rate人/小时customers/hour
UUtilization每个服务器平均忙碌比例Mean busy fraction per server无单位dimensionless
L = Lq + B;W = Wq + 1/μ;U = B/c

这里 W=Wq+1/μ 假设每个被接纳的顾客完成一次服务,平均服务时间为 1/μ;本周标准模型满足这个条件。不要把它不加判断地推广到有放弃、返工、多阶段服务的系统。

The relation W=Wq+1/μ assumes each admitted customer completes one service with mean duration 1/μ. This week's standard models satisfy that assumption. Systems with abandonment, rework, or multiple service stages require additional care.

c 个相同服务器、共同队列、只要有顾客就服务时:

For c identical servers sharing a queue, with no server left idle when a customer is waiting:
B = Σn≥0 min(n,c)πn

队列里恰好 j 人的概率:j>0 时,必须已有 c 人接受服务,所以系统总人数是 c+j。

To have exactly j customers waiting, where j>0, all c servers must be occupied. The total system population is therefore c+j.
pq,0 = π0+π1+⋯+πc;pq,j=πc+j(j>0)

7.M/M/1 为什么是生灭过程:状态只记录人数

7. Why M/M/1 is a birth–death process

Lecture 2 · slides 4–5

定义 N(t) 为时刻 t 的系统总人数。若现在有 n 人,到一个新顾客就变成 n+1,完成一次服务就变成 n−1。

Let N(t) be the total population at time t. An arrival increases n to n+1; a service completion decreases n to n−1.
当前状态Current state可能事件Possible event新状态Next state事件速率Event rate
0新顾客到达Customer arrival1λ
0服务完成Service completion不存在Not possible0
n≥1新顾客到达Customer arrivaln+1λ
n≥1当前顾客服务完成Current customer's service completionn−1μ

不要把单服务器的死亡速率写成 nμ。系统里有 10 人时仍然只有 1 人正在接受服务,因此只有一个服务完成时钟在运行。

Do not use nμ as the death rate of a single-server queue. Even with ten customers in the system, only one is receiving service, so only one service-completion clock is active.

在非空状态,两种事件竞争:新到达速率 λ,服务完成速率 μ。所以:

In a nonempty state, two event types compete: arrivals at rate λ and completions at rate μ. Thus:
离开当前状态前的平均停留时间 = 1/(λ+μ)
Mean holding time in current state = 1/(λ+μ)
下一次是到达的概率 = λ/(λ+μ);下一次是完成服务的概率 = μ/(λ+μ)
P(next event is an arrival) = λ/(λ+μ);P(next event is a completion) = μ/(λ+μ)

空状态只有到达事件,所以平均停留时间为 1/λ,下一次必然变为状态 1。

In state 0, only an arrival can occur. The mean holding time is 1/λ, and the next state must be 1.

8.一步一步推导 πₙ=(1−ρ)ρⁿ

8. Derive πₙ=(1−ρ)ρⁿ step by step

Lecture 2 · slides 5–6, 12

第一步:理解概率流,而不是只背等号

Step 1: understand probability flow

假设长期有 π₀ 的时间处在状态 0。在这些时间里,到达以速率 λ 发生。因此 0→1 的长期流率为 λπ₀。反向 1→0 的长期流率为 μπ₁。

The process spends fraction π₀ of its time in state 0, where arrivals occur at rate λ. The long-run flow from 0 to 1 is λπ₀. The reverse flow from 1 to 0 is μπ₁.

对生灭链,相邻状态之间的稳态流平衡给出:

For a birth–death chain, stationary flow balance between adjacent states gives:
λπ0=μπ1

这不是说 λ=μ,而是说速率乘以处于相应状态的概率之后,两个方向的长期流量相等。

This does not require λ=μ. It equates the long-run directional flows after multiplying each rate by its source-state probability.

第二步:从 π₀ 递推其他概率

Step 2: express the other probabilities in terms of π₀

π1=(λ/μ)π0=ρπ0
λπ1=μπ2,所以 π2=ρπ1=ρ²π0
λπ1=μπ2,therefore π2=ρπ1=ρ²π0
继续递推:πn=ρⁿπ0,其中 ρ=λ/μ
Continue the recursion: πn=ρⁿπ0,where ρ=λ/μ

第三步:利用总概率为 1,求出 π₀

Step 3: use a total probability of 1 to determine π₀

π0+π1+π2+⋯=1
π0(1+ρ+ρ²+⋯)=1

当 0≤ρ<1,括号内是无穷等比级数,总和为 1/(1−ρ)。

For 0≤ρ<1, the infinite geometric series in parentheses sums to 1/(1−ρ).
π0/(1−ρ)=1 ⇒ π0=1−ρ
πn=(1−ρ)ρⁿ,n=0,1,2,…

为什么必须 ρ<1?

Why must ρ be less than 1?

当 ρ≥1,1+ρ+ρ²+⋯发散,无法把这些权重归一化成总和为 1 的稳态概率。这里说的是无限容量、λ和μ固定的 M/M/1。

For ρ≥1, the series 1+ρ+ρ²+… diverges. These weights cannot be normalized into a stationary distribution with total mass 1. This statement applies to an infinite-capacity M/M/1 with fixed rates.

“未归一化解”是什么意思?

What is an unnormalized solution?

先把状态 0 的权重设为 1,得到权重 1,ρ,ρ²,…;这些还不是概率。把每个权重除以总权重 G,就变成概率。这是第三讲求其他模型的通用方法。

Set the weight of state 0 to 1. The weights are 1, ρ, ρ², … and are not yet probabilities. Divide each by their sum G to obtain probabilities. This method also solves the models in Lecture 3.
小例子:权重 1、2、4 如何变成概率?
Small example: how do weights 1, 2, and 4 become probabilities?

总权重 G=1+2+4=7,所以概率为 1/7、2/7、4/7。其和恰好为 1。权重大表示相对更常出现,不代表权重本身就是概率。

The sum is G=1+2+4=7. Divide by 7 to obtain probabilities 1/7, 2/7, and 4/7. A larger weight means a state is relatively more common; a weight is not itself a probability.

9.从 π 推出 L、Lq、W、Wq:每一步的理由

9. Derive L, Lq, W, and Wq from π

Lecture 2 · slides 7–9

① 平均系统人数 L

① Mean population in the system, L

期望值就是“每种人数 × 该人数的概率,再求和”。

An expectation is the sum of each possible population multiplied by its probability.
L=0π0+1π1+2π2+⋯=Σn=0∞ n(1−ρ)ρⁿ

把与 n 无关的 (1−ρ) 提出来:

Factor out (1−ρ), which does not depend on n.
L=(1−ρ)Σn=0∞ nρⁿ

已知 1+ρ+ρ²+…=1/(1−ρ),两边对 ρ 求导,再乘 ρ:

Start with 1+ρ+ρ²+…=1/(1−ρ). Differentiate with respect to ρ, then multiply by ρ.
1+2ρ+3ρ²+⋯=1/(1−ρ)²
ρ+2ρ²+3ρ³+⋯=ρ/(1−ρ)²
L=(1−ρ)·ρ/(1−ρ)²=ρ/(1−ρ)

如果暂时不熟悉求导,先把这个等比级数结果作为工具使用。关键是理解 L 是人数的加权平均。

If differentiation is unfamiliar, use the geometric-series result as a tool for now. The key idea is that L is a probability-weighted average population.

② 平均等待人数 Lq

② Mean population waiting, Lq

一个服务器要么忙,要么闲。长期忙的概率为 1−π₀=ρ,所以平均正在服务的人数 B=ρ。

A single server is either busy or idle. Its long-run busy probability is 1−π₀=ρ, so the mean number in service is B=ρ.
Lq=L−B=ρ/(1−ρ)−ρ
=[ρ−ρ(1−ρ)]/(1−ρ)=ρ²/(1−ρ)

③ 平均总时间 W

③ Mean total time in the system, W

稳定、没有阻塞和流失时,吞吐率 R=λ。由 Little 公式:

In a stable system without blocking or losses, throughput R=λ. Apply Little's law:
W=L/λ=ρ/[λ(1−ρ)]

代入 ρ=λ/μ,λ 可以消掉:

Substitute ρ=λ/μ and cancel λ.
W=1/[μ(1−ρ)]=1/(μ−λ)

④ 平均等待时间 Wq

④ Mean waiting time, Wq

Wq=W−1/μ=1/(μ−λ)−1/μ
=λ/[μ(μ−λ)]=ρ/[μ(1−ρ)]

10.Little 公式:为什么人数=流量×时间?

10. Little's law: population equals flow rate times time

Lecture 2 · slide 3

想象每小时有 10 个请求通过系统,每个请求平均占用系统 2 小时。从长期平均看,同时滞留在系统里的请求数就是 10×2=20。

If ten requests per hour pass through the system and each spends an average of two hours inside, the long-run average population is 10×2=20 requests.
L=RW;Lq=RWq

单位检查:人/小时 × 小时 = 人。Little 公式不要求泊松到达或指数服务;关键是使用同一批顾客、同一系统边界、相匹配的长期流量与时间,且相关平均值存在。

Check units: customers/hour × hours = customers. Little's law does not require Poisson arrivals or exponential services. Use the same customer population, consistent system boundaries, matching long-run flow and time measures, and well-defined averages.
系统情况System assumptions应该使用的 RCorrect throughput R原因Reason
无限容量、稳定、无流失Infinite capacity, stable, no lossesλ进入的顾客最后都会完成服务All admitted arrivals eventually complete service
外部泊松到达、容量 N、满员拒绝External Poisson arrivals, capacity N, full-state rejectionλ(1−πN)被拒绝者没有进入系统Rejected customers never enter the system
有限来源、每个系统外来源速率 λFinite sources, each outside source has rate λΣ πₙ(N−n)λ总到达率随状态变化Total arrival rate depends on the state

11.面包店完整例题与“超过 10 分钟”的概率

11. Complete bakery example and probabilities of delays over 10 minutes

Lecture 2 · slides 8–11

题设:泊松到达 λ=15 人/小时,一个店员,指数服务 μ=20 人/小时,容量无限,FCFS。

Assumptions: Poisson arrivals λ=15/hour, one clerk, exponential services μ=20/hour, infinite capacity, and FCFS.

先算利用率和概率

First calculate utilization and state probabilities

ρ=15/20=0.75;π0=0.25;πn=0.25×0.75ⁿ
n:系统人数n: population in the systemπₙ
00.250000
10.187500
20.140625
30.105469
40.079102
50.059326

“系统中至少 3 人”要把 π₃+π₄+…加起来。利用等比级数:

For at least three customers, add π₃+π₄+… . Use the geometric series:
P(N≥k)=ρᵏ;P(N≥3)=0.75³=0.421875

“没有人在排队”包括店里 0 人和店里 1 人:

Nobody is waiting when the store has either zero or one customer.
P(Nq=0)=π0+π1=0.4375

“新来的顾客需要等”只需要服务器忙,即到达时系统至少 1 人。泊松到达看到的状态比例等于长期时间比例(PASTA),因此需要等的概率是 ρ=0.75。

An arriving customer must wait whenever the server is busy: at least one customer is present. Poisson arrivals see time averages (PASTA), so the waiting probability is ρ=0.75.

再算平均人数和时间

Now calculate mean populations and times

L=0.75/0.25=3;Lq=0.75²/0.25=2.25
W=3/15=0.2 小时=12 分钟
W=3/15=0.2 hours=12 minutes
Wq=2.25/15=0.15 小时=9 分钟
Wq=2.25/15=0.15 hours=9 minutes

核对:9 分钟等待+3 分钟服务=12 分钟总时间;L−Lq=0.75,等于平均忙碌服务器数。

Check: 9 minutes of waiting plus 3 minutes of service equals 12 minutes total. L−Lq=0.75 is the mean number of busy servers.

总时间的分布

Distribution of total time in the system

设随机变量 T 为顾客在系统里的总时间,W=E[T]。在稳态 M/M/1、FCFS 下:

Let T be a customer's total time in the system, with W=E[T]. For a stationary FCFS M/M/1:
T ∼ Exponential(μ−λ);P(T>t)=e−(μ−λ)t

问总时间超过 10 分钟的概率,t=10/60 小时:

For a total time exceeding 10 minutes, substitute t=10/60 hour.
P(T>10 分钟)=e−5×10/60≈0.4346
P(T>10 minutes)=e−5×10/60≈0.4346

纯等待时间的分布

Distribution of queue waiting time

设 Tq 是开始服务前的等待时间。它有一块“完全不用等”的概率,不是普通的纯连续指数分布。

Tq is the time before service starts. It has a positive probability at zero, so it is not an ordinary continuous exponential distribution.
P(Tq=0)=1−ρ;P(Tq>t)=ρe−(μ−λ)t,t≥0
P(Tq>10 分钟)=0.75e−5×10/60≈0.3259
P(Tq>10 minutes)=0.75e−5×10/60≈0.3259

已经确定“需要等待”的顾客,其条件平均等待时间为 1/(μ−λ)=12 分钟;所有顾客平均等待则是 0.75×12=9 分钟。

Conditional on having to wait, mean waiting time is 1/(μ−λ)=12 minutes. Averaging over all arrivals gives 0.75×12=9 minutes.

为什么“服务时间相加”能用到泊松次数?

Why can a sum of service times be expressed with a Poisson count?

到达时系统已有 k 人,就需要等 k 个人完成,再完成自己的服务。在指数服务的无记忆性下,这 k+1 段时间独立同分布,总和为 Erlang(k+1, μ)。尚未完成的概率等于在 t 内完成的次数不超过 k:

If k customers are present on arrival, those k must finish before the new customer completes service. Memorylessness gives k+1 independent exponential stages, whose sum is Erlang(k+1,μ). Not finishing by time t means at most k completions have occurred by t.
P(T>t | 到达时有 k 人)=Σi=0k e−μt(μt)ⁱ/i!
P(T>t | k customers present on arrival)=Σi=0k e−μt(μt)ⁱ/i!

再按 k 的概率 πₖ 加权,得到前面的指数尾概率。注意:时间本身是 Erlang;次数才用泊松概率来表示。

Average over k using πₖ to obtain the exponential tail above. The duration is Erlang conditional on k; the completion count is represented with Poisson probabilities.

为什么利用率接近 100% 会等很久?

Why do delays grow sharply near 100% utilization?

μ 固定 20 人/小时μ fixed at 20 customers/hourρ平均总时间 WMean total time W平均等待 WqMean queue wait Wq
λ=1050%6 分钟6 min3 分钟3 min
λ=1575%12 分钟12 min9 分钟9 min
λ=1890%30 分钟30 min27 分钟27 min
λ=1995%60 分钟60 min57 分钟57 min
λ=19.899%300 分钟300 min297 分钟297 min

12.有限容量 M/M/1/N:满了以后不再进入

12. Finite-capacity M/M/1/N: reject arrivals when full

Lecture 3 · slides 2–4

假设一个店员,店里最多 N 人,满员时新顾客被拒绝。状态只有 0,1,…,N。状态 N 时没有被接纳的新到达,所以向上的状态转移速率为 0。

One clerk serves at most N customers in the system. Arrivals are rejected when full. States are 0 through N. At N, there are no admitted arrivals, so the upward state-transition rate is zero.

递推关系仍然是 πₙ=ρⁿπ₀,但这次求和到 N 就结束:

The recursion remains πₙ=ρⁿπ₀, but the sum now stops at N.
G=1+ρ+ρ²+⋯+ρᴺ;πn=ρⁿ/G
ρ≠1:πn=(1−ρ)ρⁿ/(1−ρN+1)
ρ=1:πn=1/(N+1)

与无限队列不同,这里的和是有限项。只要 λ和μ为正,有限状态不可约链有稳态,即使 ρ>1 也可以计算。

Unlike an infinite queue, this normalization has finitely many terms. For positive λ and μ, the finite irreducible chain has a stationary distribution even when ρ>1.

例:λ=15,μ=20,容量 N=3

Example: λ=15, μ=20, capacity N=3

ρ=0.75;G=1+0.75+0.5625+0.421875=2.734375
系统人数 nSystem population n未归一化权重Unnormalized weight稳态概率Stationary probability
0164/175≈0.365714
10.7548/175≈0.274286
20.562536/175≈0.205714
30.42187527/175≈0.154286

满员概率为 π₃=27/175。由于外部到达是泊松过程,约 15.43% 的到达顾客被拒绝。

The full-state probability is π₃=27/175. With external Poisson arrivals, about 15.43% of attempted arrivals are rejected.
R=15(1−27/175)=12.685714 人/小时
R=15(1−27/175)=12.685714 customers/hour
L=(1×48+2×36+3×27)/175=201/175≈1.148571 人
L=(1×48+2×36+3×27)/175=201/175≈1.148571 customers
B=1−π0=111/175≈0.634286
Lq=L−B=90/175≈0.514286 人
Lq=L−B=90/175≈0.514286 customers
W=L/R≈5.432432 分钟;Wq=W−3≈2.432432 分钟
W=L/R≈5.432432 minutes;Wq=W−3≈2.432432 minutes

平均等待变短,部分原因是顾客被拒绝。比较方案时还必须同时考虑服务成功率,不能只看等待时间。

The shorter wait partly results from rejecting customers. Compare admission or service success rates as well as waiting times.

平均人数的通式

General formula for the mean population

L=Σn=0N nπn
ρ≠1:L=ρ/(1−ρ) − (N+1)ρN+1/(1−ρN+1)
ρ=1:L=N/2

手算小 N 时,直接求和往往更稳妥。ρ=1 时每个状态等概率,不要把 ρ=1 代入含有 1−ρ 的分母。

For small N, direct summation is often safer by hand. When ρ=1, all states are equally likely; do not substitute ρ=1 into an expression with denominator 1−ρ.

13.M/M/c:多服务器共用一个等待队列

13. M/M/c: multiple servers sharing one queue

Lecture 3 · slide 5

c 是服务器数量,每个服务器服务速率为 μ。总到达速率仍然是 λ。来一个顾客后,若有空闲服务器就立即服务,否则加入共同队列。

There are c servers, each with rate μ, and the total arrival rate is λ. An arrival starts service immediately if a server is free; otherwise it joins the common queue.
系统人数 nSystem population n忙碌服务器Busy servers总服务完成速率Total completion rate
000
11μ
2(c≥2)22μ
n<cnnμ
n≥cccμ
a=λ/μ;ρ=λ/(cμ)=a/c;无限容量稳态条件 ρ<1
a=λ/μ;ρ=λ/(cμ)=a/c;Infinite-capacity stability condition ρ<1

a 表示平均服务时长内的到达量,单位可视为 Erlangs。ρ 才是每个服务器的平均利用率。单服务器时 a=ρ,多服务器时二者不同。

a is the mean number of arrivals during one mean service time, also called offered load in Erlangs. ρ is average utilization per server. They coincide with one server but differ with multiple servers.

先递推权重,再归一化

Recurse through the weights, then normalize

w0=1;wn=wn−1·λ/[min(n,c)μ]
0≤n<c:wn=aⁿ/n!;n≥c:wn=(aᶜ/c!)ρn−c
π0=[Σn=0c−1 aⁿ/n! + (aᶜ/c!)/(1−ρ)]−1

n<c 时,多来一个人会增加一个忙碌服务器,所以分母会依次出现 μ、2μ、3μ。n≥c 后所有服务器都忙,总速率封顶为 cμ,所以权重尾部变成等比数列。

For n<c, each extra customer activates another server, giving completion rates μ, 2μ, 3μ, and so on. At n≥c, all servers are busy and the rate is capped at cμ. The weight tail is therefore geometric.

等待概率(Erlang C)

Waiting probability: Erlang C

新顾客需要等,当且仅当到达时所有 c 个服务器都忙。该事件包括 n=c,c+1,…:

A new arrival waits exactly when all c servers are busy. This includes states c, c+1, and higher.
C=P(需要等待)=π0(aᶜ/c!)/(1−ρ)
C=P(wait)=π0(aᶜ/c!)/(1−ρ)
Lq=Cρ/(1−ρ);Wq=C/(cμ−λ)
W=Wq+1/μ;L=λW;B=λ/μ=a;U=ρ

完整例题:λ=9/小时,μ=10/小时,c=2

Worked example: λ=9/hour, μ=10/hour per server, c=2

a=0.9;ρ=9/20=0.45
π0=[1+0.9+(0.9²/2)/(1−0.45)]−1≈0.379310
C=0.379310×0.405/0.55≈0.279310
Wq=0.279310/(20−9)≈0.025392 小时≈1.523511 分钟
Wq=0.279310/(20−9)≈0.025392 hours≈1.523511 minutes
W=1.523511+6≈7.523511 分钟
W=1.523511+6≈7.523511 minutes
Lq=9×0.025392≈0.228527;L≈1.128527

14.M/M/c/N、M/M/c/c 与 M/M/∞

14. M/M/c/N, M/M/c/c, and M/M/∞

Lecture 3 · slides 5, 9

A.M/M/c/N:既有多个服务器,也有总容量上限

A. M/M/c/N: multiple servers with a total capacity limit

假设 N≥c。最简单可靠的算法是有限权重递推:

Assume N≥c. A reliable method is finite-state weight recursion.
w0=1;wn=wn−1λ/[min(n,c)μ],n=1,…,N
πn=wn/Σk=0Nwk
R=λ(1−πN);L=Σnπn;Lq=Σmax(n−c,0)πn
W=L/R;Wq=Lq/R;U=[Σmin(n,c)πn]/c

有限容量下,λ/(cμ) 是外部提供的负载比,未必等于实际利用率。实际 U 由成功进入的流量决定:U=R/(cμ)。

For finite capacity, λ/(cμ) is the offered-load ratio and need not equal actual utilization. Actual utilization depends on admitted throughput: U=R/(cμ).

B.M/M/c/c:没有排队位置,称为损失系统

B. M/M/c/c: a loss system with no waiting room

当 N=c,上面的有限模型变为无等待系统。定义 a=λ/μ:

Setting N=c gives a no-wait system. Define a=λ/μ.
πn=(aⁿ/n!)/[Σk=0caᵏ/k!],0≤n≤c
Erlang B:P(阻塞)=πc=(aᶜ/c!)/[Σk=0caᵏ/k!]
Erlang B:P(blocking)=πc=(aᶜ/c!)/[Σk=0caᵏ/k!]
Lq=0;Wq=0;W=1/μ;L=R/μ

例:λ=9、μ=10、c=2。a=0.9,总权重=1+0.9+0.405=2.305。阻塞概率=0.405/2.305≈0.175705。接纳率约82.43%。成功进入的人无需排队,平均服务6分钟。

Example: λ=9, μ=10, c=2. Then a=0.9 and the sum of weights is 1+0.9+0.405=2.305. Blocking probability is 0.405/2.305≈0.175705, so about 82.43% are admitted. Admitted customers do not wait and receive 6 minutes of service on average.

C.M/M/∞:每个人一到就开始服务

C. M/M/∞: everyone starts service immediately

系统有 n 人,就有 n 个独立服务时钟,总完成速率 nμ。这是生灭过程:出生 λ,死亡 nμ。

With n customers, n independent service clocks run, giving total completion rate nμ. This birth–death process has birth rate λ and death rate nμ.
a=λ/μ;πn=e−aaⁿ/n!
L=a;Var(N)=a;Lq=0;Wq=0;W=1/μ

例:平均每小时15辆车进入一个容量非常充足的停车场,平均每辆停2小时,则 μ=0.5/小时,a=30,平均场内30辆车。停车位足够多时,每辆车到来立即占用一个位置,没有等待。

Example: 15 cars/hour enter a parking facility with ample space, and each stays for 2 hours on average. Then μ=0.5/hour and a=30, giving an average of 30 parked cars. With enough spaces, arrivals park immediately without waiting.

15.有限来源 M/M/1/N/N:故障机器维修模型

15. Finite-source M/M/1/N/N: machine repair

Lecture 3 · slide 10

工厂总共有 N 台机器。正常机器可能故障;坏了的机器进入维修系统,在一名维修工那里等待或维修。每台正常机器独立地以速率 λ 故障,维修时间为参数 μ 的指数分布。

A factory has N machines and one repair technician. A working machine independently fails at rate λ; a failed machine enters the repair system and waits or receives repair. Repair times are exponential with parameter μ.

状态 n 代表有 n 台机器在维修系统中。此时系统外还剩 N−n 台正常机器,因此:

State n means n machines are in the repair system. Only N−n working machines remain outside, so:
到达速率 λn=(N−n)λ;服务速率 μn=μ(n≥1)
Arrival rate λn=(N−n)λ;Service rate μn=μ(n≥1)

这里 λ 是每台正常机器的故障速率,不能当成整个工厂固定的总故障速率。

Here λ is the failure rate of each working machine, not a fixed total failure rate for the factory.
w0=1;wn=wn−1·(N−n+1)λ/μ
wn=[N!/(N−n)!](λ/μ)ⁿ;πn=wn/Σwk

例:N=3,单台故障速率 λ=0.1/小时,μ=1/小时

Example: N=3, per-machine λ=0.1/hour, repair μ=1/hour

n状态 n 的新故障速率New-failure rate in state n权重 wₙWeight wₙ
00.3/小时0.3/hour1
10.2/小时0.2/hour0.3
20.1/小时0.1/hour0.06
300.006
G=1.366;π=(1,0.3,0.06,0.006)/1.366
L=(0.3+2×0.06+3×0.006)/1.366≈0.320644 台
L=(0.3+2×0.06+3×0.006)/1.366≈0.320644 machines
R=μ(1−π0)≈0.267936 台/小时
R=μ(1−π0)≈0.267936 machines/hour
W=L/R≈1.196721 小时;Wq=W−1≈0.196721 小时
W=L/R≈1.196721 hours;Wq=W−1≈0.196721 hours

也可以从正常机器数计算 R=λ(N−L)=0.1×(3−0.320644)=0.267936,与上面完全一致。

Equivalently, use the mean number of working machines: R=λ(N−L)=0.1×(3−0.320644)=0.267936, matching the completion-rate calculation.

16.共同队列、独立队列、一台高速服务器怎么比?

16. Compare a common queue, separate queues, and one fast server

Lecture 3 · slides 6–8

先认清比较对象

Define the alternatives

共同队列:所有人排同一条队,哪个服务器空出来就去哪个。独立队列:每个服务器有自己的队列,顾客进入后通常不换队。

In a common queue, the next customer takes whichever server becomes free. With separate queues, each server has its own line and customers normally remain in their selected line.

在相同独立指数服务、同样总到达率下,把到达流平均随机分给各个独立队列,会出现一边忙、一边空的情况。共同队列能减少这种资源空闲与等待并存的现象。

With identical independent exponential services and the same total arrival rate, random equal splitting across separate queues can leave one server idle while another queue has customers waiting. A common queue reduces this mismatch.

两台速率 μ 的服务器 vs 一台速率 2μ 的服务器

Two servers of rate μ versus one server of rate 2μ

固定总能力2μ,令 ρ=λ/(2μ)。共同队列 M/M/2 的平均等待人数:

Keep total capacity at 2μ and define ρ=λ/(2μ). For a shared-queue M/M/2, the mean queue length is:
Lq,双服务器=2ρ³/(1−ρ²)
Lq,two servers=2ρ³/(1−ρ²)

一台双速服务器 M/M/1 的平均等待人数:

For one double-speed M/M/1 server, the mean queue length is:
Lq,高速单服务器=ρ²/(1−ρ)
Lq,fast single server=ρ²/(1−ρ)

两者相除得到 2ρ/(1+ρ)<1,所以双服务器共同队列的平均排队人数与平均等待时间更小。但双服务器每位顾客服务平均1/μ,高速单服务器服务平均1/(2μ)。因此高速单服务器的平均总时间反而更小。

Their ratio is 2ρ/(1+ρ)<1, so the two-server common queue has less queue waiting. However, mean service takes 1/μ with two servers versus 1/(2μ) with the fast server. The fast single server consequently has a smaller mean total time in the system.

课件 Example 6.5 的数值重算

Recalculate Example 6.5 from the slides

方案Alternative课件成本Cost in slide example模型与参数 / 小时Model and rates per hour纯等待 WqQueue wait Wq总时间 WTotal time W
现状Existing system$0M/M/1;λ=9,μ=1054 分钟54 min60 分钟60 min
更大载荷Larger loads$30,000M/M/1;λ=6,μ=152.667 分钟2.667 min6.667 分钟6.667 min
增加一个站点Another station$400,000M/M/2;λ=9,每台 μ=10M/M/2; λ=9, each μ=101.524 分钟1.524 min7.524 分钟7.524 min
再加一部电梯Another elevator$1,000,000两条独立 M/M/1;各 λ=4.5、μ=10Two independent M/M/1 queues; each λ=4.5, μ=104.909 分钟4.909 min10.909 分钟10.909 min

这些成本和参数来自课件,仅用于该例的方案比较。课件的 Waiting Time 一列实际给出 W(总时间)。这里把 Wq 和 W 拆开,避免按列名误读。

Costs and parameters are taken from this slide example only. Its Waiting Time column actually reports total time W. We show Wq and W separately to avoid confusing the two.

17.排队规则改变什么?

17. What changes when the queue discipline changes?

Lecture 3 · slide 11

FCFS:先来的先处理。LCFS:后来的先处理。RSS:随机取下一个。课件在标准比较条件下给出:平均等待相同,但等待时间方差不同,FCFS 较小,LCFS 较大,RSS 居中。

FCFS serves the earliest arrival; LCFS serves the latest arrival; RSS selects a waiting customer randomly. Under the comparison assumptions in the slides, mean waiting is the same but its variance differs: lower for FCFS, higher for LCFS, and intermediate for RSS.

理解方法:只要服务器持续处理同一群平均服务要求相同的顾客,改变顺序可能只是把等待时间在顾客之间重新分配。FCFS通常更均匀,LCFS可能让很早到的人等特别久。

Changing the order may redistribute waiting across customers while the server keeps processing the same class of service requirements. FCFS tends to spread waits more evenly; LCFS can leave an early arrival waiting a very long time.

若可以估计服务时长,课件提到优先处理短任务。短任务优先会改变平均等待表现,已不属于“与服务时长无关地换个顺序”这一类比较。实际调度还需要考虑长任务饥饿、公平性、截止时间与估计误差。

When service durations can be estimated, the slides suggest giving shorter tasks priority. This can change average waiting and is outside the service-time-independent comparison. Real scheduling must also consider starvation of long tasks, fairness, deadlines, and estimation errors.

18.对照课件阅读:页码、疑点与正确用法

18. Reading guide: slide mapping and points to check

三份课件逐页对应
来源Source页码Slide numbers本文件对应Corresponding sections
Lecture 12第1、16节:系统结构Sections 1 and 16: system structure
Lecture 13–4第2节:17位顾客的时间表Section 2: timeline for 17 customers
Lecture 15–7第1、4、5节:术语和Kendall符号Sections 1, 4, 5: terms and Kendall notation
Lecture 22–3第6、10节:指标关系与Little公式Sections 6 and 10: measures and Little's law
Lecture 24–6、12第7、8节:生灭链、稳态概率、归一化Sections 7 and 8: birth–death chain, stationary probabilities, normalization
Lecture 27–9第9、11节:人数、等待、总时间分布Sections 9 and 11: populations, waiting, total-time distribution
Lecture 210–11第11节:面包店和利用率Section 11: bakery and utilization
Lecture 32–4第12节:M/M/1/NSection 12: M/M/1/N
Lecture 35第13、14节:多服务器Sections 13 and 14: multiple servers
Lecture 36–8第16节:结构和成本比较Section 16: structure and cost comparison
Lecture 39–11第14、15、17节:损失、无限服务器、有限来源与规则Sections 14, 15, 17: loss, infinite servers, finite sources, disciplines

需要特别标出的地方

Points that need special attention

  1. Lecture 2 slide 4,几何分布均值:若 P(X=x)=p(1−p)ˣ,x从0开始,E[X]=(1−p)/p。1/p是从1开始计数的定义。M/M/1人数从0开始,因此 L=ρ/(1−ρ)。
    Lecture 2, slide 4: if P(X=x)=p(1−p)^x for x=0,1,…, the mean is (1−p)/p. The mean 1/p belongs to the version starting at 1. M/M/1 population starts at 0, so L=ρ/(1−ρ).
  2. Lecture 2 slide 9,“k个顾客”的边界:计算 k+1段剩余服务时间时,k必须是到达时系统中已有的人数,包含正在服务的人;若只数等待队列人数,非空时会少数一个。
    Lecture 2, slide 9: the k customers must be the total number already in the system, including the customer in service. Counting only those waiting misses one service stage when the system is nonempty.
  3. Lecture 2 slide 9,时间与次数:k+1个指数服务时间之和为Erlang分布,泊松分布用于表示t内的完成次数。最终混合得到总时间的指数分布。
    Lecture 2, slide 9: a sum of k+1 exponential durations is Erlang. Poisson probabilities describe completion counts in time t. Mixing over the population yields the exponential total-time distribution.
  4. Lecture 2 slide 10,面包店W:正确代入是 W=L/λ=3/15=0.2小时。不能把利用率0.75当成λ代入。
    Lecture 2, slide 10: use W=L/λ=3/15=0.2 hour. The utilization 0.75 is not the arrival rate.
  5. Lecture 3 slide 8,Waiting Time:表中60、6.67、7.52、10.91分钟对应W,不是Wq。
    Lecture 3, slide 8: the listed 60, 6.67, 7.52, and 10.91 minutes are total times W, not queue waits Wq.
  6. Lecture 3 slide 5,近似公式:课件标明是approximation的多服务器Lq表达式,不应代替所有情况下的精确公式。这里使用Erlang C精确式。
    Lecture 3, slide 5: the multi-server Lq expression marked as an approximation should not replace exact results in every case. This handout uses the exact Erlang C formula.
  7. Lecture 3 slide 9,负载符号:损失系统与无限服务器公式里的负载用a=λ/μ;多服务器利用率用ρ=λ/(cμ)。使用公式前先检查符号定义。
    Lecture 3, slide 9: use a=λ/μ in the loss and infinite-server formulas, and ρ=λ/(cμ) for multi-server utilization. Check each symbol's definition before substituting.

这些备注用于帮助阅读与计算,不改动老师原课件。数学排版在不同软件中可能显示不同,应以完整公式和变量定义为准。

These notes support reading and calculation without changing the original slides. Mathematical formatting may differ between programs; use the complete formula together with its variable definitions.

19.离线计算器:先选模型,再改参数

19. Offline calculator: choose a model before changing parameters

配套学习工具 · 时间单位统一为小时

输入 λ、μ 均使用“每小时”。有限来源模型中的 λ 是每个系统外来源的速率。时间输出为分钟。计算器使用精确稳态公式或有限状态归一化,不使用随机仿真。

Enter λ and μ in rates per hour. In the finite-source model, λ is the rate of each source outside the system. Time outputs are in minutes. The calculator uses stationary formulas or finite-state normalization, not random simulation.

系统人数分布

Distribution of the number in the system

无限模型仅显示前若干个人数的概率,并单独列出剩余尾概率。M/M/∞按递推计算可见部分;非常大的均值可能使低状态概率下溢,此时保留均值指标并说明限制。有限模型内部使用对数权重归一化。

Infinite models show the first few state probabilities and a separate remaining tail. For M/M/∞, visible probabilities use recursion; a very large mean can underflow low-state probabilities. Finite models normalize log weights.

20.练习:先自己算,再展开答案

20. Exercises: solve first, then reveal the answer

由本课程概念编写的补充练习

这些题是学习用补充例题,不是老师的原题。先写出模型和单位,再动手算。

These are supplementary learning exercises, not the instructor's original problems. Identify the model and units before calculating.
练习1:一个店员,2人等待。系统人数是多少?
Exercise 1: one clerk is serving and two customers are waiting. How many are in the system?

有1人正在接受服务,另外2人等待,因此系统人数3,等待人数2。若没有人正在服务,且系统工作保持,就不应还让2人继续排队。

One is in service and two are waiting, so N=3 and Nq=2. A work-conserving system would not leave the server idle while customers wait.
练习2:平均每5分钟来一人,每人平均服务4分钟。求λ、μ、ρ。
Exercise 2: one arrival every 5 minutes on average; mean service is 4 minutes. Find λ, μ, and ρ.

λ=60/5=12人/小时;μ=60/4=15人/小时;ρ=12/15=0.8。若满足M/M/1假设,则有稳态,因为0.8<1。

λ=60/5=12/hour; μ=60/4=15/hour; ρ=12/15=0.8. Under M/M/1 assumptions, a stationary distribution exists because 0.8<1.
练习3:接上题,求L、Lq、W、Wq。
Exercise 3: continue Exercise 2. Find L, Lq, W, and Wq.

L=0.8/0.2=4人。Lq=0.64/0.2=3.2人。W=4/12小时=20分钟。Wq=3.2/12小时=16分钟。核对:16+4=20分钟。

L=0.8/0.2=4; Lq=0.64/0.2=3.2. W=4/12 hour=20 minutes. Wq=3.2/12 hour=16 minutes. Check: 16+4=20 minutes.
练习4:ρ=0.8时,系统为空、队列为空、新顾客需要等待的概率各是多少?
Exercise 4: for ρ=0.8, find the probabilities of an empty system, an empty queue, and an arrival needing to wait.

系统为空π₀=0.2。队列为空π₀+π₁=0.2+0.16=0.36。泊松新顾客需要等的概率是ρ=0.8。某时刻有人已经在等待的概率是ρ²=0.64。

An empty system has probability π₀=0.2. An empty queue has π₀+π₁=0.2+0.16=0.36. A Poisson arrival waits with probability ρ=0.8. Someone is already waiting at a random time with probability ρ²=0.64.
练习5:λ=12、μ=15,顾客总时间超过10分钟的概率?
Exercise 5: λ=12, μ=15. What is the probability that total time exceeds 10 minutes?

参数μ−λ=3/小时,t=1/6小时。P(T>t)=exp(−3/6)=exp(−0.5)≈0.606531。纯等待超过10分钟的概率是0.8×0.606531≈0.485225。

μ−λ=3/hour and t=1/6 hour. P(T>t)=exp(−0.5)≈0.606531. Queue waiting exceeds 10 minutes with probability 0.8×0.606531≈0.485225.
练习6:M/M/1/4,λ=μ=10/小时。求π、L、R、W。
Exercise 6: M/M/1/4 with λ=μ=10/hour. Find π, L, R, and W.

ρ=1,状态0到4共5个,各概率0.2。L=N/2=2人。R=10×(1−0.2)=8人/小时。W=2/8小时=15分钟。服务平均6分钟,所以Wq=9分钟。B=0.8,Lq=1.2。

ρ=1. All five states 0–4 have probability 0.2. L=4/2=2. R=10(1−0.2)=8/hour. W=2/8 hour=15 minutes. Mean service is 6 minutes, so Wq=9 minutes. B=0.8 and Lq=1.2.
练习7:M/M/3,λ=24/小时,每台μ=10/小时。有稳态吗?
Exercise 7: M/M/3, λ=24/hour and each μ=10/hour. Does a steady state exist?

总能力cμ=30/小时,ρ=24/30=0.8<1,有稳态。系统1、2、3、4人时的总服务完成速率分别是10、20、30、30/小时。

Total capacity is 30/hour and ρ=24/30=0.8<1, so yes. For populations 1, 2, 3, and 4, total completion rates are 10, 20, 30, and 30/hour.
练习8:M/M/2/5,总容量5意味着最多几个人等待?
Exercise 8: in M/M/2/5, how many customers can wait at most?

2人服务,最多5−2=3人等待。有限模型满员时被接纳的到达速率为0。外部尝试到达仍然存在,只是不改变系统人数。

Two receive service and at most 5−2=3 wait. When full, the admitted arrival rate is zero. External arrival attempts still occur but do not change the system population.
练习9:M/M/2/2的Wq为0,是否意味着没有顾客受到影响?
Exercise 9: M/M/2/2 has Wq=0. Does that mean every customer is unaffected?

不是。成功进入者无需等待,但两台服务器都忙时,新顾客被拒绝。必须同时计算阻塞概率π₂及吞吐率R=λ(1−π₂)。

No. Admitted customers do not wait, but arrivals finding both servers busy are rejected. Also calculate blocking probability π₂ and throughput R=λ(1−π₂).
练习10:5台机器,已有2台进入维修系统,单台故障速率0.1/小时。总新故障速率?
Exercise 10: five machines, two already in repair, per-working-machine failure rate 0.1/hour. What is the total new-failure rate?

正常机器还剩5−2=3台,所以λ₂=3×0.1=0.3/小时。不是5×0.1,也不是2×0.1。

Three machines remain working. Thus λ₂=(5−2)×0.1=0.3/hour. Do not multiply the rate by all five machines or by the two failed machines.
练习11:M/M/∞,λ=12/小时,平均服务10分钟。求L、W、Wq。
Exercise 11: M/M/∞, λ=12/hour, mean service 10 minutes. Find L, W, and Wq.

μ=6/小时,a=12/6=2。L=2;W=10分钟;Wq=0;人数分布Poisson(2),P(N=0)=exp(−2)≈0.135335。

μ=6/hour and a=12/6=2. L=2, W=10 minutes, and Wq=0. Population is Poisson(2), so P(N=0)=exp(−2)≈0.135335.
练习12:π₀=0.4,一个服务器。平均忙碌人数为什么不是1?
Exercise 12: π₀=0.4 with one server. Why is the mean number of busy servers not 1?

60%的时间服务1人,40%的时间服务0人,所以B=0.6。长期平均L=Lq+0.6。不能因为“有一个服务器”就认为它始终在服务一个人。

The server serves one customer 60% of the time and none 40% of the time, so B=0.6. Therefore L=Lq+0.6. Having one server does not imply it is always busy.

21.解题清单与公式速查

21. Problem-solving checklist and formula reference

复习页
  1. 把顾客、服务器、系统边界说清楚。
    Identify the customers, servers, and system boundary.
  2. 确定到达是否泊松、服务是否指数,以及独立性等假设。
    Check Poisson arrivals, exponential services, independence, and other assumptions.
  3. 找出λ、每台μ、c、N;把时间统一为小时或分钟。
    Find λ, the per-server μ, c, and N; use one consistent time unit.
  4. 无限容量检查λ<cμ;有限容量用有限状态归一化。
    For infinite capacity, check λ<cμ. For finite capacity, normalize the finite-state weights.
  5. 求π,再求L、Lq、B;或者使用该模型的精确公式。
    Find π, then L, Lq, and B, or use the model's exact formulas.
  6. 确认实际吞吐率R,使用W=L/R、Wq=Lq/R。
    Find actual throughput R and calculate W=L/R and Wq=Lq/R.
  7. 核对L=Lq+B、W=Wq+1/μ、概率和为1、结果单位正确。
    Check L=Lq+B, W=Wq+1/μ, total probability 1, and the units.
模型Model稳态人数概率或权重Stationary population probability or weight关键指标Key measures
M/M/1,ρ=λ/μ<1πₙ=(1−ρ)ρⁿL=ρ/(1−ρ),Lq=ρ²/(1−ρ),W=1/(μ−λ)
M/M/1/Nwₙ=ρⁿ;πₙ=wₙ/ΣwR=λ(1−πN),ρ=1时L=N/2R=λ(1−πN); L=N/2 when ρ=1
M/M/c,ρ=λ/(cμ)<1wₙ=aⁿ/n!(n<c);尾部为等比wₙ=aⁿ/n! for n<c; geometric tailC=π₀(aᶜ/c!)/(1−ρ),Wq=C/(cμ−λ)
M/M/c/Nwₙ=wₙ₋₁λ/[min(n,c)μ]L=Σnπₙ,Lq=Σmax(n−c,0)πₙ
M/M/c/cwₙ=aⁿ/n!,n≤c阻塞πc;Wq=0;W=1/μBlocking πc; Wq=0; W=1/μ
M/M/∞πₙ=e⁻ᵃaⁿ/n!,a=λ/μL=a;Wq=0;W=1/μ
M/M/1/N/Nwₙ=[N!/(N−n)!](λ/μ)ⁿR=λ(N−L)=μ(1−π₀)

22.原始资料与使用方式

22. Sources and how to use this handout

来源记录

本学习文件依据你提供的以下三份课程课件整理,讲授教师为 Christopher Slon, PhD,课程 ISE/SYS 5517 Statistical Methods in Engineering:

This handout is based on the following ISE/SYS 5517 Statistical Methods in Engineering slides taught by Christopher Slon, PhD.
  1. 5517 Week 7 Lecture 1 - Basic Queueing Concepts.pptx(7页)。
    5517 Week 7 Lecture 1 - Basic Queueing Concepts.pptx (7 slides).
  2. 5517 Week 7 Lecture 2 - M-M-1 Queue.pptx(12页)。
    5517 Week 7 Lecture 2 - M-M-1 Queue.pptx (12 slides).
  3. 5517 Week 7 Lecture 3 - M-M- Queues.pptx(11页)。
    5517 Week 7 Lecture 3 - M-M- Queues.pptx (11 slides).

课件中的面包店到达/服务数据、面包店λ=15及μ=20例题、Example 6.5方案成本与参数均保留来源。有限容量N=3、有限来源3台机器、停车场、补充练习及计算器示例属于为解释概念而新增的例子。各节顶部标明课件对应页码。

The 17-customer data, bakery λ=15 and μ=20 example, and Example 6.5 costs and parameters come from the slides. The N=3 finite-capacity example, three-machine repair example, parking example, exercises, and calculator examples are added teaching examples. Section headers identify the corresponding slide numbers.

文件不需要联网:文字、公式、目录、折叠答案、计算器与概率条形图均在单个HTML中。公式使用Unicode与HTML上下标,无需MathJax。推荐在Safari、Chrome或Edge中打开。打印按钮会展开练习答案并隐藏交互控件,可另存为PDF。用顶部搜索可以高亮关键词,按Enter跳到下一处匹配。

This single HTML file works offline, including text, formulas, navigation, answers, calculator, and probability bars. Formulas use Unicode and HTML subscripts and superscripts. Open it in Safari, Chrome, or Edge. Printing expands answers and hides interactive controls. Search highlights terms; Enter moves to the next match. Use the language selector for bilingual, Chinese-only, or English-only reading.

版本:v2 · 中英文对照版。建议学习顺序:先概念,再M/M/1,再容量限制,再多服务器,最后有限来源。

Version v2 · Bilingual revision. Suggested order: concepts, M/M/1, finite capacity, multiple servers, and finite sources.