Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am geting error message Array indices must be positive integers or logical values. MMCQ ( line 9 4 4 ) pN = p
I am geting error message Array indices must be positive integers or logical values.
MMCQ line
pN pstateNwait ; How can I correct it to show that Nwait includes all callers in the queue and being served as well The following code is to aid in solving the decision tree problem.
function AB idMap ArrangeMatrixP
Partitions the matrix P in the following form
P A B
I
by rearranging the matrix P to put all the absorbing states in the bottom right corner.
INPUTS:
P Markov chain matrix
OUTPUTS:
A Matrix
B Matrix
idMap Mapping of old state # to new state #
Pstar P;
toRowCol lengthP; Where to put the next absorp state
stateID :toRowCol;
Determine if there are any absorbing states
nrowsncols findPstar ;
while ~isemptynrows
Get the state to move
nrow nrows;
ncol ncols;
Swap Row
tempcol Pstarncol:;
Pstarncol: PstartoRowCol:;
PstartoRowCol: tempcol;
Swap column
temprow Pstar:nrow;
Pstar:nrow Pstar:toRowCol;
Pstar:toRowCol temprow;
Swap the state IDs
temp stateIDtoRowCol;
stateIDtoRowCol stateIDnrow;
stateIDnrow temp;
Decrement rowcolumn destination
toRowCol toRowCol ;
Find the next one to move
nrowsncols findPstar:toRowCol,:toRowCol;
end
Get the submatries
A Pstar:toRowCol,:toRowCol;
B Pstar:toRowCol,toRowCol:end;
idMap stateID;
end
Define the erlang function
function B erlangbN A
if lengthN~fixN ~ NN
errorN must be a scalar positive integer';
end
TODO: test that elements of A are real and positive here?
esum zerossizeA;
for ii:N
esum esum A ii factorialii;
end
B A N factorialN esum;
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started