The problem is to estimate the long-term probability that at least one server in a two-server computer network is working during any given hour. We'll model this problem as a Markov chain as follows:
Assume the network can be in one of three states:
1.
|
Both servers are working
|
3.
|
Neither server is working
|
Let:
•
|
be the probability that a server fails when both were okay an hour ago
|
•
|
be the probability that the second server fails when one was okay an hour ago
|
•
|
be the probability that a broken server gets fixed when one was okay an hour ago
|
•
|
be the probability that a broken server gets fixed when both were down an hour ago
|
The transition matrix is then the following:
>
|
P := Matrix( [ [1-mu[1], mu[1], 0],
[lambda[1], 1-(lambda[1]+mu[2]), mu[2]],
[0, lambda[2], 1-lambda[2]] ] );
|
Note that the steadyStateVector procedure computes symbolically. Numerical values for and are not required.
>
|
pi := steadyStateVector( P );
|
is currently a symbolic vector. Let's supply some example values:
>
|
lambda[1]:=1/400; lambda[2]:=1/800; mu[1]:=1/4; mu[2]:=1/8;
|
Ask Maple for the value of , and the updated vector is given, reflecting the inputs above. By inspection, we see the vector is stochastic.
>
|
pi := steadyStateVector( P );
|
The long-term probability that at least one server is operable in any given hour is the sum of the last two components of .
>
|
probWorking := pi[2] + pi[3];
|
If we want a 10-digit floating-point approximation to this probability, use the evalf command.
>
|
evalf( probWorking, 10 );
|
Erase the current values of lambda and mu.
>
|
lambda := 'lambda'; mu := 'mu';
|
Let's generalize this Markov chain, allowing for the possibility of both servers going down at once or both being repaired at once.
>
|
P := Matrix( [ [1-(mu[1]+mu[3]), mu[1], mu[3]],
[lambda[1], 1-(lambda[1]+mu[2]), mu[2]],
[lambda[3], lambda[2], 1-(lambda[2]+lambda[3])] ] );
|
>
|
pi := steadyStateVector( P );
|
What about a purely numeric matrix?
>
|
P2 := Matrix( [[1/4, 1/2, 1/4], [1/3, 1/3, 1/3], [1/4, 1/2, 1/4]]);
|
>
|
pi := steadyStateVector( P2 );
|
>
|
P3 := Matrix( [[.25, .45, .3], [.13, .33, .64], [.2, .6, .2]]);
|
>
|
pi := steadyStateVector( P3 );
|