2 % @brief Expected maximum of K i.i.d. exponential random variables
4 % @author LINE Development Team
8 % @brief Expected maximum of K i.i.d. exponential random variables
11 % Computes the expected value of the maximum of K independent and
12 % identically distributed exponential random variables with rate mu
13 % (mean service time x = 1/mu).
15 % X_K^max = H_K / mu = H_K * x
17 % where H_K
is the K-th Harmonic number.
19 % This
is a fundamental quantity in Fork-Join analysis. For a split-merge
20 % (SM) queueing system, the maximum throughput
is lambda_K^SM = 1 / X_K^max.
22 % For large K, X_K^max ≈ (ln(K) + gamma) / mu, where gamma ≈ 0.57721
is
23 % the Euler-Mascheroni constant.
27 % Xmax = fj_xmax_exp(K, mu)
32 % <tr><th>Name<th>Description
33 % <tr><td>K<td>Number of parallel servers (positive integer)
34 % <tr><td>mu<td>Service rate (mean service time
is 1/mu)
39 % <tr><th>Name<th>Description
40 % <tr><td>Xmax<td>Expected maximum service time X_K^max = H_K / mu
44 % A. Thomasian,
"Analysis of Fork/Join and Related Queueing Systems",
45 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
46 % Page 17:2 and Eq. (10) on page 17:11.
48function Xmax = fj_xmax_exp(K, mu)
51 line_error(mfilename,
'K must be a positive integer. Got K=%d.', K);
55 line_error(mfilename,
'Service rate mu must be positive. Got mu=%.4f.', mu);
58% Compute harmonic number H_K
61% Expected maximum: X_K^max = H_K / mu