Question: Matrix Calculation

Could you help me make this code work?

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Matrix.mw .
 

Download Matrix.mw

 

restart;
with(LinearAlgebra);
A := 8; B := 5;
q := .4; p := .2; r := 1-p-q;
dimP := A+B+1;
P := Matrix(dimP, dimP, [0$dimP*dimP]);
P[1, 1] := 1; P[1, 2] := 0;
P[dimP, dimP] := 1; P[dimP, dimP-1] := 0;
for i from 2 to dimP-1 do P[i, i-1] := q; P[i, i] := r; P[i, i+1] := p end do;
p0 := Matrix(dimP, 1, [0$dimP]);
p0[A+1, 1] := 1;
pV[0] := p0;
PT := Transpose(P);
for n to 200 do pV[n] := PT . pV[n-1] end do;
map(proc (x) options operator, arrow; evalf(x, 3) end proc, Transpose(pV[5]));

 

Please Wait...