Professional Documents
Culture Documents
Exam 04
Exam 04
UNIVERSITY OF YORK
Answer 4 questions.
Standard calculators will be provided but should be unnecessary.
1 Turn over
0580020
'$ '$
1 - 4
&%
&%
@
@
@ @
@ @
@ @
@
'$ @ '$
@
@ R
@
@
α @ β
&% &%
@
@ @
@ @
@ @
@ @
@ @
@ '$ '$
@
R
@
R
@
3 - 2
&% &%
4
continued from previous page 0580020
'$
?
3,4 -
3,6
β
&%
'$ '$
2,3 2,2
A B
&% &%
6 6
1,4 5,7
'$
α
&%
2. PART A
(i) For the network shown above, an initial flow along each arc and
the capacity of that arc are marked. Perform one iteration of the
labelling algorithm to increase the flow shown from α to β.
(6 marks)
(ii) Show a sequence of flow patterns on the network terminating
at a maximal flow which arises from repeated application of the
labelling algorithm. (In this section you are not asked to perform
each labelling, just the results of applying the labelling procedure
until a maximal flow is attained.)
(6 marks)
(iii) Explain why the flow reached in part (ii) above is maximal.
(3 marks)
'$ '$
2
E - D
&%
&%
@
@ @ 7
@ @
4 @
@ @
@
'$ @ '$
@
@
@ 3 R
@
A @ α
&% &%
@
@ @
@ @
@ @
6 @ @
@ @ 3
@ '$ '$
@
R
@
R
@
B - C
&% &%
5
PART B
To calculate the lengths of the shortest paths from all nodes to a
single node in a network Dijkstra’s algorithm maintains and updates
(a) a set P of permanently labelled nodes, (b) a set T of temporarily
labelled nodes, (c) the permanent labels and (d) the temporary
labels.
Consider the directed network above; where arc lengths are marked.
For this network, explain how Dijkstra’s algorithm may be used to
calculate the least distances from the nodes A, B, C, D, E to the
node α; indicating the sets P and T at each iteration and the labels
attached to the nodes in these two sets at each iteration.
(10 marks)
(i) For all (X1 , X2 ) such that F1 (X1 ) > F2 (X2 ), let
V (X) = X1 {[F1 (X1 ) − F2 (X2 )]}.
Show that d[V (X(t))]/dt < 0 for all t > 0.
(5 marks)
[You may assume here that F1 (X1 (t)) > F2 (X2 (t)) for all t ≥ 0.]
(ii) Illustrate this result by drawing and commenting on a figure
which demonstrates that V (X(t)) declines as time passes.
(5 marks)
(iii) Show how to define an objective function W such that
grad W (X) = F (X)
for all X = (X1 , X2 ) such that X1 ≥ 0 and X2 ≥ 0. Using your
definition of W , prove that d[W (X(t))]/dt < 0 for all t > 0.
(5 marks)
[You may assume here that F1 (X1 (t)) > F2 (X2 (t)) for all t ≥ 0.]
(iv) Illustrate this result by drawing and commenting on a figure
which demonstrates that W (X(t)) declines as time passes.
(5 marks)
(v) Does it follow from the conditions on F and X that F1 (X1 (t)) >
F2 (X2 (t)) for all t ≥ 0? Justify your answer.
(5 marks) 8
0580020
(10 marks)
(iii) Let NQ be the mean number of customers in the queue. The
mean waiting time in the queue, W is given by
1
W = R + NQ .
µ
(iv) A system with a slow output line queues data packets. The
data packets arrive with a Poisson distribution at a rate λ
and have lengths which are independent and identically dis-
tributed. The lengths are flatly distributed between s (short-
est) and l (longest) bytes with s, l ∈ N : s ≤ l. When it is free,
the system sends the first packet in the queue and takes n ms
(n/1000 seconds) to send a packet of length n bytes.
Calculate λm the maximum sending rate in packets/second
which gives the system 100% utilisation ρ = 1.
(3 marks)
(v) Let the actual arrival rate λ = λm /2. Show that the average
waiting time W for a packet is given by
useful.
(7 marks).
11 Turn over
0580020
(8 marks)
(v) For the M/M/m/m system find, in terms of π0 and ρ (the
utilisation), the probability that, when a randomly chosen cus-
tomer arrives the customer is turned away.
(5 marks)
12
0580020
6. (i) Define the terms tree, subtree, minimum weight spanning tree
(MST) and fragment.
(4 marks)
(ii) Prove the following proposition:
Let F be a fragment of a graph G. Let α = (i, j) be a the
minimum weight arc in G such that i ∈ F and j 6∈ F . If F 0 is
constructed by adding the node j and the arc α to F then F 0
is also a fragment.
You may use without proof the fact that the number of arcs
in a tree is given by A = N − 1 where A is the number of arcs
and N is the number of nodes.
(6 marks)
(iii) Define the Prim-Dijkstra algorithm. Assuming it begins at
node 1 in the figure below, list the order in which it adds arcs
and draw the final MST.
5
2 3
1 2
6
1 4 4
3
3 5
6 5
6
(5 marks)
(iv) Consider the Markov chain with states numbered 1 and 2 and
the following transition matrix
" #
2/5 3/5
P=
1/3 2/3
14
0580020
1.
2.
3.
4. (i) Three marks for some easy book work. Figure 1 shows residual
times for the M/G/1 queuing system.
X1
X1 X2 XM (t) t
Time τ
(ii) Again, simple book work. Expressing the area under the graph
in two different ways
t M (t)
1 1X1 2
Z
r(τ )dτ = X
t 0 t i=1 2 i
15
0580020
Now, since the output rate must be the input rate λ then
M (t)
lim = λ.
t→∞ t
Substituting above gives the required formula
1
R = λX 2 .
2
(iii) From Little’s Theorem NQ = W λ. Therefore
1
W = λX 2 + W ρ.
2
leading to the required answer
λX 2
W = .
2(1 − ρ)
(iv) The average packet transmission time is
l+s l+s
X= ms = sec ,
2 2000
and therefore since µ = 1/X and ρ = λ/µ then
l+s
1 = λm seconds.
2000
Hence
2000
λm = packets/second .
l+s
(v) The second moment of service time is given by
Pl 2 Pl 2 Ps−1 2
2 i=s i i=0 i − i=0 i
X = 2
= .
1000 (1 + l − s) 1, 000, 000(1 + l − s)
From the given equation
l(l + 1)(2l + 1) − (s − 1)s(2s − 1)
X2 = .
1, 000, 000(1 + l − s)
Therefore, from the P-K equation with λ = 1000/(l + s) and
ρ = 1/2 then
l(l + 1)(2l + 1) − (s − 1)s(2s − 1)
W = seconds.
1000(l + s)(1 + l − s)
16
0580020
OFF ON
λ0 λ1 λ2 λn−1 λn
0 1 2 ... n ...
µ1 µ2 µ3 µn µn+1
17
0580020
(iv) This is new work (which was suggested as an exercise for stu-
dents in class) but should not be too challenging. The case for
π0 has already been shown. Assume that
n
Y λi−1
πn = π0 .
i=1
µi
18
0580020
19
0580020
20