1
COMP SCI/SFWR ENG 4/6E03 Assignment 7 Solutions
1. Here, we have two M/M/1 queues with 1 = 3p/2 and 2 = 2(1p). Using the expressions
for expected number in system, we have that the total is
3p
2 2p
+
.
2 3p 2p 1
I plugged this into Maple, differentiated

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 4E03 Test 1 Solutions
1. (a)
The expected time before X breaks is given by
Z
P (X > x + h|X > x)dh
E(X|X > x) = x +
0
From the memoryless property of the exponential random variable P (X > x + h|X >
x) = P (X > h), we have
Z
Z
P (X

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

1
COMP SCI/SFWR ENG 4/6E03 Assignment 1 Solutions
1. To get c
Z
f (x)dx = 1
Z 10
c
x1.8 = 1
1
1
1 2.8 10
=
x |1
c
2.8
c = 0.0044
For the mean, E[X]:
Z
xf (x)dx
E[X] =
Z 10
= 0.0044
x2.8 dx
1
0.0044 3.8 10
x |1
3.8
= 7.30
=
Finally,
P cfw_X > E[X] = 0.00

1
COMP SCI/SFWR ENG 4/6E03 Assignment 5 Solutions
10.1 One possible choice of state is three-valued - the first is the current page, the next two
are the pages in the cache. This gives six possible states: (1,1,2), (2,1,2), (1,1,3), (3,1,3),
(3,2,3) and (

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

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

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.

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 4/6E03 Assignment 7
1. We have a two server system that we describe as follows. The interarrival times follow
an exponential distribution with rate 6. The processing time distribution at server 1 is
exponential with rate 4 and the proc

1
COMP SCI/SFWR ENG 4/6E03 Assignment 1
1. Suppose that X has probability density function
f (x) = cx1.8 ,
1 < x < 10,
Calculate c, E[X], and P cfw_X > E[X].
2. Suppose that in a particular organization, 36 percent of programmers are proficient in
Java an

COMP SCI/SFWR ENG 4E03 Assignment 9
The second and third questions are taken from Probability and Statistics with Reliability,
Queuing and Computer Science Applications by Trivedi.
1. Suppose we have the following web server network. There are 250 clients