1
COMP SCI/SFWR ENG 4/6E03 Assignment 4 Solutions
1. First, you need to calculate the expected number of visits that each request makes to each
device. The number of visits to the CPU is geometrically distributed with parameter 0.04,
so the expected numbe

COMP SCI/SFWR ENG 4E03
Continuous-Time Markov Chains
From DTMCs to CTMCs
For DTMCs, transitions only made at discrete time steps. Want to
generalize to transitions that can happen at any time, but keep the
state space countable.
CTMC Denition
A Continuous

COMP SCI/SFWR ENG 4E03
Discrete-Time Markov Chains
COMP SCI/SFWR ENG 4E03 Discrete-Time Markov Chains
Introductory Example
Consider the following (very simplied) scenario:
three web pages that link to each other, A, B, C
page A has links to B and C
pag

COMP SCI/SFWR ENG 4E03
Operational Analysis
Operational Laws
First cut at analytic models. Suppose that we have the following
data:
Ai (t) - number of arrivals to device i at time t
Ci (t) - number of completions (departures) from device i at
time t
Bi

COMP SCI/SFWR ENG 4E03
Infinite State
Discrete-Time Markov Chains
General Observations
same results hold relating limiting and stationary distributions,
only proofs are trickier - this is because interchanging limits
and infinite sums has to be done with

COMP SCI/SFWR ENG 4E03
DTMCs and PageRank
Search Engine Goals
search engine matches search terms, but also ranks
wish to rank pages based on popularity (assume match
already done)
Proposal 1
The popularity of a page is determined by the number of
backl

COMP SCI/SFWR ENG 4E03
Exponential Distribution
and Poisson Process
Exponential Distribution - Property 1
As a reminder, the memoryless property is defined as
Pcfw_X > s + t|X > s = Pcfw_X > t
With this in mind, we have the first property. Given X1 Exp(1

COMP SCI/SFWR ENG 4E03
Discrete-Time Markov Chains
Introductory Example
Consider the following (very simplified) scenario:
three web pages that link to each other, A, B, C
page A has links to B and C
page B has a link to C
page C has links to A and B

COMP SCI/SFWR ENG 4E03
Continuous-Time Markov Chains
From DTMCs to CTMCs
For DTMCs, transitions only made at discrete time steps. Want to
generalize to transitions that can happen at any time, but keep the
state space countable.
CTMC Definition
A Continuo

COMP SCI/SFWR ENG 4E03
Operational Analysis
Operational Laws
First cut at analytic models. Suppose that we have the following
data:
Ai (t) - number of arrivals to device i at time t
Ci (t) - number of completions (departures) from device i at
time t
Bi

COMP SCI/SFWR ENG 4E03
Simulation
Description of a Queueing System
a simple queue consists of a buffer/queue where arriving jobs
wait to be served by a server - after completing processing,
they depart
Must describe:
Arrivals - the time between arrivals

COMP SCI/SFWR ENG 4E03
Crash Course in Probability
Overview
What do we mean by performance? Consider the data centre
example on the board.
1
Throughput - how many requests per time unit can the data
centre handle?
2
Response time - how long is a job in th

1
COMP SCI/SFWR ENG 4E03 - Past Questions (Test 1)
1. We want to compare the response times of two proposed systems. We are given the
following observations.
System A: 3.83, 2.62, 0.74, 13.46, 11.72, 2.54
System B: 2.39, 29.20, 5.75, 16.23, 5.24, 2.25
Wit

1
COMP SCI/SFWR ENG 4/6E03 Solutions to Test 1
1. (a)
10(0.9)3 (0.1)2 = 0.0729
(b)
(0.9)3 + 3(0.9)2 (0.1)(0.9) + 6(0.9)2 (0.1)2 (0.9) = .992
(c)
(0.9)3 = 0.729
2. (a) We are given Dcpu = 4.2. Now, from the information about how jobs visit the CPU,
VCP U =

1
COMP SCI/SFWR ENG 4E03 Test 1
80 minutes
1. A circuit has two component types C and D. C fails after X days where X EXP(C )
and D fails after Y days where Y EXP(D ). The two components fail independently.
Repair cost of component C, follows a uniform di

COMP SCI/SFWR ENG 4/6E03 - Sample
Questions for Test 1 - Solutions
October 16, 2016
1. (a) E[next request] = 1 minute beause it is exponentially distributed,
and is memoryless
(b) Var(X) = 2/3
2. k = 6
P (X < 4months) = P (X < 1/3year) =
7
27
0.259
3. (a

1
COMP SCI/SFWR ENG 4/6E03 - Sample Questions for Test 1
1. Short Answer Questions.
(a) The time between user requests is exponentially distributed with mean 1 minute.
One minute has passed since the last request. What is the expected time to the next
req

1
COMP SCI/SFWR ENG 4/6E03 - Sample Questions for Test 1
1. Short Answer Questions.
(a) The time between user requests is exponentially distributed with mean 1 minute.
One minute has passed since the last request. What is the expected time to the next
req

1
COMP SCI/SFWR ENG 4/6E03 Assignment 4
1. Consider a system with N users, a CPU and two disks. A request from the users first
visits the CPU. After processing at the CPU, with probability 0.48 the request visits disk
A, 0.48 it visits disk B and 0.04 it

1
COMP SCI/SFWR ENG 4/6E03 Assignment 6
1. Consider a system that has one component of type A and one component of type B. The
times to fail of components of type A and B are exponentially distributed with means
200 and 20 hours, respectively. Failed comp

1
COMP SCI/SFWR ENG 4E03 Assignment 8
1. Text, 17.1
2. Write a CSIM implementation of the system in the first question. Use your results from
the first question to help verify that your simulation is working correctly. Now, determine
the average number of

1
COMP SCI/SFWR ENG 4/6E03 Assignment 2 Solutions
1. First, we need to find the distribution. For 1 x 2,
F (x) =
Z x 2
3y
1
7
dy =
x3 1
.
7
7
Now,
F 1 (x) = (7(x + 1/7)1/3 .
To generate the required sample, take a sample u from U [0, 1] and choose (7(u +

1
COMP SCI/SFWR ENG 4/6E03 Assignment 3
1. Database transactions perform an average of 4.5 disk operations on a database server
with a single disk. The database server was monitored during one hour and during this
period, 7,200 transactions were executed.

1
COMP SCI/SFWR ENG 4/6E03 Assignment 9 Solutions
1. The assumption that we need to make is probabilistic routing. So, assume that the
dispatcher assigns requests to the processors with equal probability. A similar assumption
is made for the routing after

1
COMP SCI/SFWR ENG 4E03 Assignment 10
1. Consider the 3-machine, 2-repairman problem as discussed in lecture. As a reminder,
there are three machines and we would like to keep as many as possible simultaneously
operating. The time to failure of each mach

1
COMP SCI/SFWR ENG 4/6E03 Assignment 2
1. Suppose that a random variable X has density
f (x) = 3x2 /7
for 1 x 2 and 0 otherwise. Using a PRNG that gives samples from a U[0,1] distribution, how can one generate samples from X?
2. Ten independent simulatio

1
COMP SCI/SFWR ENG 4E03 Assignment 10 Solutions
1. If the state is the number of machines failed, we would like to calculate E[T0,3 ].
E[T0,3 ] =
E[T1,3 ] =
E[T2,3 ] =
100
+ E[T1,3 ]
3
1
0.5
0.02
+
E[T0,3 ] +
E[T2,3 ]
.02 + .5 0.02 + 0.5
0.02 + 0.5
1
1
+