quit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Finding a stable distribution %% Problem 30, p. 412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A = [.69 .16 .2;.12 .74 .14;.19 .1 .66] A = 0.6900 0.1600 0.2000 0.1200 0.7400 0.1400 0.1900 0.1000 0.6600 B = A-eye(3) B = -0.3100 0.1600 0.2000 0.1200 -0.2600 0.1400 0.1900 0.1000 -0.3400 C = [1 1 1 1;B(1,:) 0;B(2,:) 0; B(3,:) 0] C = 1.0000 1.0000 1.0000 1.0000 -0.3100 0.1600 0.2000 0 0.1200 -0.2600 0.1400 0 0.1900 0.1000 -0.3400 0 rref(C) ans = 1.0000 0 0 0.3661 0 1.0000 0 0.3317 0 0 1.0000 0.3022 0 0 0 0 %% Therefore the stable distribution is approximately %% x = .3611 %% y = .3317 %% z = .3022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% We could also have ignored the last row of C %% because we know that Gauss-Jordan will yield a zero row. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% C1 = C(1:3,:) C1 = 1.0000 1.0000 1.0000 1.0000 -0.3100 0.1600 0.2000 0 0.1200 -0.2600 0.1400 0 %% Note that the MATLAB command says to take rows 1 to 3, and all %% columns of C rref(C1) ans = 1.0000 0 0 0.3661 0 1.0000 0 0.3317 0 0 1.0000 0.3022 %% This yields the same stable distribution. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Finally we could find the stable distribution %% by taking higher and higher powers of the transition %% matrix A %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A A = 0.6900 0.1600 0.2000 0.1200 0.7400 0.1400 0.1900 0.1000 0.6600 A^5 ans = 0.3908 0.3433 0.3614 0.2997 0.3879 0.3087 0.3095 0.2688 0.3299 A^10 ans = 0.3674 0.3645 0.3664 0.3289 0.3364 0.3299 0.3036 0.2992 0.3037 A^15 ans = 0.3662 0.3660 0.3662 0.3315 0.3321 0.3315 0.3023 0.3019 0.3023 A^20 ans = 0.3661 0.3661 0.3661 0.3317 0.3317 0.3317 0.3022 0.3021 0.3022 A^25 ans = 0.3661 0.3661 0.3661 0.3317 0.3317 0.3317 0.3022 0.3022 0.3022 %% For any higher power the columns will not change %% up to 4 decimal places A^100 ans = 0.3661 0.3661 0.3661 0.3317 0.3317 0.3317 0.3022 0.3022 0.3022 %% Each column is the same as the stable distribution found %% earlier. quit